choking on non-food

<Someone> (also later forwarded by <Someone>) reported that choking
while eating non-food always resulted in calling it a "quick snack".
lesshungry() depends on an occupation to tell if you are actually eatig or
not, but since non-food is eaten in one turn, no occupation was set.  Took
his suggestion of setting the occupation temporarily to cause lesshungry()
call choke() appropriately in this case.
This commit is contained in:
cohrs
2003-05-21 18:32:40 +00:00
parent e6ed77f634
commit 3862424fa7
2 changed files with 4 additions and 0 deletions

View File

@@ -72,6 +72,7 @@ clean up data set by join_map that is overlaid by MAPs on special levels
clarify disclose option default in opthelp, and support "all" as old help said
add more calls to update_inventory as the inventory changes
don't charge for items picked up from monster's interior while swallowed
choking while eating non-food always called the food "quick snack"
Platform- and/or Interface-Specific Fixes

View File

@@ -1569,7 +1569,10 @@ eatspecial() /* called after eating non-food */
{
register struct obj *otmp = victual.piece;
/* lesshungry wants an occupation to handle choke messages correctly */
set_occupation(eatfood, "eating non-food", 0);
lesshungry(victual.nmod);
occupation = 0;
victual.piece = (struct obj *)0;
victual.eating = 0;
if (otmp->oclass == COIN_CLASS) {