diff --git a/doc/fixes36.2 b/doc/fixes36.2 index ac6f516f6..fa28f3768 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -176,6 +176,8 @@ prayer result which enhanced strength (fix weakness from hunger) didn't give a message if a change in encumbrance occurred; it came on next move add current location within the dungeon to the Background section of ^X and final disclosure (it's not background but doesn't fit anywhere else) +death from something other than loss of hit points could leave hero with + non-zero HP at end of game (during "really die?" prompt, disclosure) Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/end.c b/src/end.c index 93216c76c..2d9c754c7 100644 --- a/src/end.c +++ b/src/end.c @@ -1037,8 +1037,17 @@ int how; if (!killer.name[0] || how >= PANICKED) Strcpy(killer.name, deaths[how]); - if (how < PANICKED) + if (how < PANICKED) { u.umortality++; + /* in case caller hasn't already done this */ + if (u.uhp > 0 || (Upolyd && u.mh > 0)) { + /* for deaths not triggered by loss of hit points, force + current HP to zero (0 HP when turning into green slime + is iffy but we don't have much choice--that is fatal) */ + u.uhp = u.mh = 0; + context.botl = 1; + } + } if (Lifesaved && (how <= GENOCIDED)) { pline("But wait..."); makeknown(AMULET_OF_LIFE_SAVING);