From: nethack.rankin Date: Sat, 14 Sep 2002 13:24:22 +0000 (+0000) Subject: disclosure after sink fall X-Git-Tag: MOVE2GIT~2421 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b789a08f94d1f89448cbb7f38e7bc9d3518ccbe3;p=nethack disclosure after sink fall 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. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index f2315110f..029608800 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -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 diff --git a/src/hack.c b/src/hack.c index 0e366318a..748529822 100644 --- a/src/hack.c +++ b/src/hack.c @@ -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;