]> granicus.if.org Git - nethack/commitdiff
cut trees and dug walls replaced by corridor symbols
authorcohrs <cohrs>
Sun, 11 Aug 2002 17:40:08 +0000 (17:40 +0000)
committercohrs <cohrs>
Sun, 11 Aug 2002 17:40:08 +0000 (17:40 +0000)
- In various places, cutting down a tree would result in a corridor symbol
showing up, although trees are generally found in room-like areas.  Added
the missing checks.
- Trees were diggable except on mazelike levels.  Added the missing check.
- In a cavernous town like minetn-6, digging a wall would result in a
corridor symbol being displayed instead of a doorway.  This looked strange,
especially in the town.  Added a check for this, making use of the new
meaning of in_town(); non-town parts of this level still do CORR
replacement as expected.

src/dig.c
src/hack.c

index 85e18fcd1b8231790dc2f24041305eeabb9dbcb7..980790f862457953f15601a4b58f0d904ad09f14 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -350,7 +350,8 @@ dig()
                        }
                        if (level.flags.is_maze_lev) {
                            lev->typ = ROOM;
-                       } else if (level.flags.is_cavernous_lev) {
+                       } else if (level.flags.is_cavernous_lev &&
+                                  !in_town(dpx, dpy)) {
                            lev->typ = CORR;
                        } else {
                            lev->typ = DOOR;
@@ -1095,7 +1096,8 @@ register struct monst *mtmp;
                add_damage(mtmp->mx, mtmp->my, 0L);
            if (level.flags.is_maze_lev) {
                here->typ = ROOM;
-           } else if (level.flags.is_cavernous_lev) {
+           } else if (level.flags.is_cavernous_lev &&
+                      !in_town(mtmp->mx, mtmp->my)) {
                here->typ = CORR;
            } else {
                here->typ = DOOR;
@@ -1222,6 +1224,13 @@ 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;
@@ -1231,13 +1240,16 @@ zap_dig()
                        shopwall = TRUE;
                    }
                    watch_dig((struct monst *)0, zx, zy, TRUE);
-                   if (level.flags.is_cavernous_lev) {
+                   if (level.flags.is_cavernous_lev && !in_town(zx, zy)) {
                        room->typ = CORR;
                    } else {
                        room->typ = DOOR;
                        room->doormask = D_NODOOR;
                    }
                    digdepth -= 2;
+               } else if (IS_TREE(room->typ)) {
+                   room->typ = ROOM;
+                   digdepth -= 2;
                } else {        /* IS_ROCK but not IS_WALL or SDOOR */
                    room->typ = CORR;
                    digdepth--;
index c5a83099f41b219690bcf55c136d25dac345c7bd..3773967335563258c9094d4e77413b98b7b3d82b 100644 (file)
@@ -382,12 +382,15 @@ still_chewing(x,y)
        digtxt = "chew a hole in the wall.";
        if (level.flags.is_maze_lev) {
            lev->typ = ROOM;
-       } else if (level.flags.is_cavernous_lev) {
+       } else if (level.flags.is_cavernous_lev && !in_town(x, y)) {
            lev->typ = CORR;
        } else {
            lev->typ = DOOR;
            lev->doormask = D_NODOOR;
        }
+    } else if (IS_TREE(lev->typ)) {
+       digtxt = "chew through the tree.";
+       lev->typ = ROOM;
     } else if (lev->typ == SDOOR) {
        if (lev->doormask & D_TRAPPED) {
            lev->doormask = D_NODOOR;