]> granicus.if.org Git - nethack/commitdiff
fix U193 - digging feedback for undiggable trees
authornethack.rankin <nethack.rankin>
Wed, 18 Dec 2002 17:38:57 +0000 (17:38 +0000)
committernethack.rankin <nethack.rankin>
Wed, 18 Dec 2002 17:38:57 +0000 (17:38 +0000)
> Zapping a wand of digging at trees in ranger's quest gives a message
> "rock glows then fades".

     There was code to handle this, but it didn't work due to the
definition of IS_TREE making checks for STONE be sensitive to code
ordering (STONE was checked first in this case).

#define IS_TREE(typ)    ((typ) == TREE || \
                        (level.flags.arboreal && (typ) == STONE))

Why is it defined this way?  Shouldn't STONE simply be converted
into TREE when arboreal levels get created?

doc/fixes34.1
src/dig.c

index 4e272586a9bda480375e541d42d059fe537daed5..84ceaff6ab60004c2f1ba53017f29026ad616adb 100644 (file)
@@ -330,6 +330,7 @@ non-moving monster are not affected by liquid
 'A' command behaved differently depending on menustyle when non-weapons were
        present in the quiver or alternate weapon inventory slots
 most cases of the hero dropping things need to check for dropping on an altar
+zapping undiggable trees with wand or spell of dig gave feedback about rock
 
 
 Platform- and/or Interface-Specific Fixes
index 90dab741eb618fcf33e0f24e88fa48261f5d3be9..1070d91e03d143ad1da426a4463207e5ac005472 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)dig.c      3.4     2002/04/06      */
+/*     SCCS Id: @(#)dig.c      3.4     2002/12/18      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1228,19 +1228,19 @@ zap_dig()
                    } else if (!Blind)
                        pline_The("wall glows then fades.");
                    break;
-               } else if (room->typ == STONE || room->typ == SCORR) {
+               } else if (IS_TREE(room->typ)) { /* check trees before stone */
                    if (!(room->wall_info & W_NONDIGGABLE)) {
-                       room->typ = CORR;
+                       room->typ = ROOM;
                        unblock_point(zx,zy); /* vision */
                    } else if (!Blind)
-                       pline_The("rock glows then fades.");
+                       pline_The("tree shudders but is unharmed.");
                    break;
-               } else if (IS_TREE(room->typ)) {
+               } else if (room->typ == STONE || room->typ == SCORR) {
                    if (!(room->wall_info & W_NONDIGGABLE)) {
-                       room->typ = ROOM;
+                       room->typ = CORR;
                        unblock_point(zx,zy); /* vision */
                    } else if (!Blind)
-                       pline_The("tree glows then fades.");
+                       pline_The("rock glows then fades.");
                    break;
                }
            } else if (IS_ROCK(room->typ)) {