]> granicus.if.org Git - nethack/commitdiff
Don't prompt to continue eating with one bite left
authorMichael Meyer <me@entrez.cc>
Fri, 17 Jun 2022 14:42:14 +0000 (10:42 -0400)
committerPatR <rankin@nethack.org>
Sat, 2 Jul 2022 22:27:49 +0000 (15:27 -0700)
There was already handling in place to prevent showing the "continue
eating?" prompt for one-gulp food (like a wraith corpse), since the hero
would finish eating the food on that turn regardless of what the player
answered to the prompt.  Resuming an interrupted multi-bite meal with
only a single bite remaining had the same problem, but wasn't accounted
for in the special "one gulp" handling.  Modify the condition so it
checks for the number of bites remaining in the food, not the number of
bites total, and show the prompt only when there's more than one bite
left.

src/eat.c

index 60e3d11db9a102561817c6579dff29ae27c9bb33..b454874bd130358114a0804a6876cd17abb4968c 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -3140,8 +3140,9 @@ lesshungry(int num)
             } else {
                 g.context.victual.fullwarn = TRUE;
                 if (g.context.victual.canchoke
-                    && g.context.victual.reqtime > 1) {
-                    /* a one-gulp food will not survive a stop */
+                    && (g.context.victual.reqtime
+                        - g.context.victual.usedtime) > 1) {
+                    /* food with one bite left will not survive a stop */
                     if (!paranoid_query(ParanoidEating, "Continue eating?")) {
                         reset_eat();
                         g.nomovemsg = (char *) 0;