From: cohrs Date: Wed, 21 May 2003 18:32:40 +0000 (+0000) Subject: choking on non-food X-Git-Tag: MOVE2GIT~1967 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3862424fa76c9a9f785a9074c6480d2f62d6ef67;p=nethack choking on non-food (also later forwarded by ) 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. --- diff --git a/doc/fixes34.2 b/doc/fixes34.2 index 1e503d048..8779aad49 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -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 diff --git a/src/eat.c b/src/eat.c index 2f0afd157..8783871ea 100644 --- a/src/eat.c +++ b/src/eat.c @@ -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) {