fix U193 - digging feedback for undiggable trees

> 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?
This commit is contained in:
nethack.rankin
2002-12-18 17:38:57 +00:00
parent 3f3ce17256
commit eba488996f
2 changed files with 9 additions and 8 deletions

View File

@@ -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,6 +1228,13 @@ zap_dig()
} else if (!Blind)
pline_The("wall glows then fades.");
break;
} else if (IS_TREE(room->typ)) { /* check trees before stone */
if (!(room->wall_info & W_NONDIGGABLE)) {
room->typ = ROOM;
unblock_point(zx,zy); /* vision */
} else if (!Blind)
pline_The("tree shudders but is unharmed.");
break;
} else if (room->typ == STONE || room->typ == SCORR) {
if (!(room->wall_info & W_NONDIGGABLE)) {
room->typ = CORR;
@@ -1235,13 +1242,6 @@ zap_dig()
} else if (!Blind)
pline_The("rock glows then fades.");
break;
} else if (IS_TREE(room->typ)) {
if (!(room->wall_info & W_NONDIGGABLE)) {
room->typ = ROOM;
unblock_point(zx,zy); /* vision */
} else if (!Blind)
pline_The("tree glows then fades.");
break;
}
} else if (IS_ROCK(room->typ)) {
if (!may_dig(zx,zy)) break;