]> granicus.if.org Git - nethack/commitdiff
disclosure after sink fall
authornethack.rankin <nethack.rankin>
Sat, 14 Sep 2002 13:24:22 +0000 (13:24 +0000)
committernethack.rankin <nethack.rankin>
Sat, 14 Sep 2002 13:24:22 +0000 (13:24 +0000)
     From the newsgroup:  if you die from the fall when losing
levitation while moving over a sink, the final attributes still
said you were levitating.

doc/fixes34.1
src/hack.c

index f2315110f848d5a71f107048be2b6d66d5079801..029608800c8bf0f61e57d2ceb2b3b48d5b7cd9f5 100644 (file)
@@ -247,6 +247,7 @@ when a pet starves to death, say so instead of just "Fido dies."
 starved pet raised from dead shouldn't immediately starve again
 skilled spell of detected treasure wasn't acting like blessed potion of
        object detection (from Roderick Schertler)
+fix end of game attribute disclosure for levitation negated by sink
 
 
 Platform- and/or Interface-Specific Fixes
index 0e366318a09a37190a2ebc41f788eec1382fd64b..74852982263a5ec7e32c093a6b3d8feff465ccf8 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)hack.c     3.4     2002/07/27      */
+/*     SCCS Id: @(#)hack.c     3.4     2002/09/14      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -453,6 +453,13 @@ dosinkfall()
        if (is_floater(youmonst.data) || (HLevitation & FROMOUTSIDE)) {
            You("wobble unsteadily for a moment.");
        } else {
+           long save_ELev = ELevitation, save_HLev = HLevitation;
+
+           /* fake removal of levitation in advance so that final
+              disclosure will be right in case this turns out to
+              be fatal; fortunately the fact that rings and boots
+              are really still worn has no effect on bones data */
+           ELevitation = HLevitation = 0L;
            You("crash to the floor!");
            losehp(rn1(8, 25 - (int)ACURR(A_CON)),
                   fell_on_sink, NO_KILLER_PREFIX);
@@ -464,6 +471,8 @@ dosinkfall()
                    losehp(rnd(3), fell_on_sink, NO_KILLER_PREFIX);
                    exercise(A_CON, FALSE);
                }
+           ELevitation = save_ELev;
+           HLevitation = save_HLev;
        }
 
        ELevitation &= ~W_ARTI;