]> granicus.if.org Git - nethack/commitdiff
choking on non-food
authorcohrs <cohrs>
Wed, 21 May 2003 18:32:40 +0000 (18:32 +0000)
committercohrs <cohrs>
Wed, 21 May 2003 18:32:40 +0000 (18:32 +0000)
<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.

doc/fixes34.2
src/eat.c

index 1e503d048c779716c13103f726eecbadba5b9591..8779aad49cfcc9b3a7b85a707d4b4f0d020356e3 100644 (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
index 2f0afd157b8f0ba946f96991691280628cf91a2d..8783871ea246dc72a669e65a8a318f0406982a92 100644 (file)
--- 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) {