]> granicus.if.org Git - nethack/commitdiff
fix #H4706 - non-zero hit points for poison death
authorPatR <rankin@nethack.org>
Fri, 9 Dec 2016 00:39:55 +0000 (16:39 -0800)
committerPatR <rankin@nethack.org>
Fri, 9 Dec 2016 00:39:55 +0000 (16:39 -0800)
For "the poison was deadly" against hero, hit points were set to -1
(which gets displayed as 0 when shown) but the status lines weren't
being updated, so stale positive HP value was visible during final
disclosure.

doc/fixes36.1
src/attrib.c
src/end.c

index 9fd1a03a99f9daea22f33b6903f913eb621e9f1b..28aa198acddf485fd7f25c17ac8cb45b62e1f4d6 100644 (file)
@@ -360,6 +360,8 @@ Elbereth now erodes based on attacks by the player, not monsters scared
 novels are made of paper, not gold
 movement speeds are made less predictable by using random rounding, rather
        than via adding a random offset
+some death by the-poison-was-deadly situations left stale non-zero HP shown
+       on the status line during final disclosure
 
 
 Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
index bdb1ff1f10cffced87c27a63e1a77c609deaa9ac..c87afb683627788a43368ab9236b12f74f304af5 100644 (file)
@@ -272,6 +272,7 @@ boolean thrown_weapon; /* thrown weapons are less deadly */
     if (i == 0 && typ != A_CHA) {
         /* instant kill */
         u.uhp = -1;
+        context.botl = TRUE;
         pline_The("poison was deadly...");
     } else if (i > 5) {
         /* HP damage; more likely--but less severe--with missiles */
index d097292fbf6a0eece058c111e722f260578cac6e..08141258fb6ee7cac0343fc1dea6a2dfd06ae72e 100644 (file)
--- a/src/end.c
+++ b/src/end.c
@@ -922,6 +922,18 @@ int how;
             return;
         }
     }
+    if (program_state.panicking
+#ifdef HANGUPHANDLING
+        || program_state.done_hup
+#endif
+        ) {
+        /* skip status update if panicking or disconnected */
+        context.botl = context.botlx = FALSE;
+    } else {
+        /* otherwise force full status update */
+        context.botlx = TRUE;
+        bot();
+    }
 
     if (how == ASCENDED || (!killer.name[0] && how == GENOCIDED))
         killer.format = NO_KILLER_PREFIX;