From 9d8782eb8f7372f1289eed8e955fc89cd6847ad5 Mon Sep 17 00:00:00 2001 From: cohrs Date: Sun, 11 Aug 2002 17:40:08 +0000 Subject: [PATCH] cut trees and dug walls replaced by corridor symbols - 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 | 18 +++++++++++++++--- src/hack.c | 5 ++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/dig.c b/src/dig.c index 85e18fcd1..980790f86 100644 --- 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--; diff --git a/src/hack.c b/src/hack.c index c5a83099f..377396733 100644 --- a/src/hack.c +++ b/src/hack.c @@ -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; -- 2.40.0