From 9b0ad2585775b05a5141c8660f9899348e6c3a60 Mon Sep 17 00:00:00 2001 From: mogami Date: Sat, 14 Sep 2002 09:59:48 +0000 Subject: [PATCH] =?utf8?q?=E9=9A=A0=E3=81=97=E3=83=88=E3=83=A9=E3=83=83?= =?utf8?q?=E3=83=97=E3=81=AB=E9=9A=A3=E6=8E=A5=E3=81=97=E3=81=A6=E8=B5=B0?= =?utf8?q?=E3=82=8B=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E3=82=92=E5=85=A5?= =?utf8?q?=E5=8A=9B=E3=81=99=E3=82=8B=E3=81=A8=E3=80=8C=E3=81=9D=E3=81=AE?= =?utf8?q?=E6=96=B9=E5=90=91=E3=81=AB=E3=81=AF=E3=81=84=E3=81=91=E3=81=BE?= =?utf8?q?=E3=81=9B=E3=82=93=E3=80=8D=20=E3=81=A8=E8=A8=80=E3=82=8F?= =?utf8?q?=E3=82=8C=E3=82=8B=E4=BA=8B=E3=81=8C=E3=81=82=E3=81=A3=E3=81=9F?= =?utf8?q?=E3=83=90=E3=82=B0=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cave.c | 1 - src/cmd1.c | 46 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/cave.c b/src/cave.c index 3821b5709..99c5c47f6 100644 --- a/src/cave.c +++ b/src/cave.c @@ -4686,7 +4686,6 @@ void map_area(int range) void wiz_lite(bool wizard, bool ninja) { int i, y, x; - cave_type *c_ptr; byte feat; /* Memorize objects */ diff --git a/src/cmd1.c b/src/cmd1.c index 11138a100..c3281b9a1 100644 --- a/src/cmd1.c +++ b/src/cmd1.c @@ -4243,6 +4243,9 @@ msg_format("%s */ static int see_wall(int dir, int y, int x) { + cave_type *c_ptr; + byte feat; + /* Get the new location */ y += ddy[dir]; x += ddx[dir]; @@ -4250,29 +4253,35 @@ static int see_wall(int dir, int y, int x) /* Illegal grids are not known walls */ if (!in_bounds2(y, x)) return (FALSE); + /* Access grid */ + c_ptr = &cave[y][x]; + + /* Feature code (applying "mimic" field) */ + feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic; + /* Non-wall grids are not known walls */ - if (cave[y][x].feat <= FEAT_DOOR_TAIL) return (FALSE); + if (feat <= FEAT_DOOR_TAIL) return (FALSE); - if ((cave[y][x].feat >= FEAT_DEEP_WATER) && - (cave[y][x].feat <= FEAT_GRASS)) return (FALSE); + if ((feat >= FEAT_DEEP_WATER) && + (feat <= FEAT_GRASS)) return (FALSE); - if ((cave[y][x].feat >= FEAT_SHOP_HEAD) && - (cave[y][x].feat <= FEAT_SHOP_TAIL)) return (FALSE); + if ((feat >= FEAT_SHOP_HEAD) && + (feat <= FEAT_SHOP_TAIL)) return (FALSE); - if (cave[y][x].feat == FEAT_DEEP_GRASS) return (FALSE); - if (cave[y][x].feat == FEAT_FLOWER) return (FALSE); + if (feat == FEAT_DEEP_GRASS) return (FALSE); + if (feat == FEAT_FLOWER) return (FALSE); - if (cave[y][x].feat == FEAT_MUSEUM) return (FALSE); + if (feat == FEAT_MUSEUM) return (FALSE); - if ((cave[y][x].feat >= FEAT_BLDG_HEAD) && - (cave[y][x].feat <= FEAT_BLDG_TAIL)) return (FALSE); + if ((feat >= FEAT_BLDG_HEAD) && + (feat <= FEAT_BLDG_TAIL)) return (FALSE); -/* if (cave[y][x].feat == FEAT_TREES) return (FALSE); */ +/* if (feat == FEAT_TREES) return (FALSE); */ /* Must be known to the player */ - if (!(cave[y][x].info & (CAVE_MARK))) return (FALSE); + if (!(c_ptr->info & (CAVE_MARK))) return (FALSE); - if (cave[y][x].feat >= FEAT_TOWN) return (FALSE); + if (feat >= FEAT_TOWN) return (FALSE); /* Default */ return (TRUE); @@ -5041,9 +5050,18 @@ void run_step(int dir) /* Start running */ if (dir) { + cave_type *c_ptr; + byte feat; + + /* Access grid */ + c_ptr = &cave[py+ddy[dir]][px+ddx[dir]]; + + /* Feature code (applying "mimic" field) */ + feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic; + /* Hack -- do not start silly run */ if (see_wall(dir, py, px) && - (cave[py+ddy[dir]][px+ddx[dir]].feat != FEAT_TREES)) + (feat != FEAT_TREES)) { /* Message */ #ifdef JP -- 2.11.0