]> granicus.if.org Git - nethack/commitdiff
fix water handling in the #H260 lava fix
authornethack.rankin <nethack.rankin>
Tue, 17 Apr 2007 03:13:08 +0000 (03:13 +0000)
committernethack.rankin <nethack.rankin>
Tue, 17 Apr 2007 03:13:08 +0000 (03:13 +0000)
     The patch made a month ago to handle remaining at a lava or pool
location without moving had a problem with being in pools of water.  It
was yielding "But you don't drown.  You touch bottom." if you had magical
breathing and took actions other than moves.  I think it's fixed now.

[New bug, or rather newly noticed old bug:  slowly sinking while being
stuck in lava doesn't notice if you lose fire resistance and ought to be
burned up immediately.  Also, fully sinking into lava doesn't appear to
burn up equipment--unless it's done in the bones handling--the way that
falling directly in without fire resistance does.]

src/hack.c

index 2f474f5f5b31ff965160206d2204b7169b929f14..cbd5bd2170ca211ac6a796e81f00f77b55529b15 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)hack.c     3.5     2007/03/12      */
+/*     SCCS Id: @(#)hack.c     3.5     2007/04/16      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1618,7 +1618,8 @@ boolean newspot;  /* true if called by spoteffects */
           location while surviving the problem */
        if (is_lava(u.ux, u.uy)) {
            if (lava_effects()) return TRUE;
-       } else if (!Wwalking) {
+       } else if (!Wwalking &&
+               (newspot || !u.uinwater || !(Swimming || Amphibious))) {
            if (drown()) return TRUE;
        }
     }