OSDN Git Service

c_ptr->mimic のコードさらにバグ取り。地形を操作する各コマンド disarm,
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 14 Sep 2002 23:43:41 +0000 (23:43 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 14 Sep 2002 23:43:41 +0000 (23:43 +0000)
open, close, bash, tunnel等、全部c_ptr->featを直接見てしまっていた。
また魔法効果 stone to mud等でc_ptr->mimicをちゃんと更新していなかった
のを修正。直接 c_ptr->feat を設定するコードをほとんど全て
cave_set_feat()で置き変えて自動的に mimic = 0 になるようにした。

src/cmd1.c
src/cmd2.c
src/hissatsu.c
src/melee2.c
src/spells1.c
src/spells2.c
src/streams.c

index c3281b9..d1437ff 100644 (file)
@@ -3459,7 +3459,6 @@ bool player_can_enter(byte feature)
 void move_player(int dir, int do_pickup, bool break_trap)
 {
        int y, x;
-       byte feat;
 
        cave_type *c_ptr;
        monster_type *m_ptr;
@@ -3479,9 +3478,6 @@ void move_player(int dir, int do_pickup, bool break_trap)
        /* Examine the destination */
        c_ptr = &cave[y][x];
 
-       /* Feature code (applying "mimic" field) */
-       feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
-
        /* Exit the area */
        if (!dun_level && !p_ptr->wild_mode &&
                ((x == 0) || (x == MAX_WID - 1) ||
@@ -3841,8 +3837,13 @@ msg_format("%s
        else if ((!cave_floor_bold(y, x)) &&
                (!p_can_pass_walls))
        {
+                byte feat;
+
                oktomove = FALSE;
 
+                /* Feature code (applying "mimic" field) */
+                feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
                /* Disturb the player */
                disturb(0, 0);
 
@@ -4040,9 +4041,7 @@ msg_format("%s
                                if (cave[py][px].feat == FEAT_TREES)
                                        cave_set_feat(py, px, FEAT_GRASS);
                                else
-                               {
-                                       cave[py][px].feat = floor_type[randint0(100)];
-                               }
+                                       cave_set_feat(py, px, floor_type[randint0(100)]);
                        }
                                /* Update some things -- similar to GF_KILL_WALL */
                        p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
index d67a4f2..a6656e1 100644 (file)
@@ -1074,11 +1074,12 @@ static int coords_to_dir(int y, int x)
  *
  * Returns TRUE if repeated commands may continue
  */
-static bool do_cmd_open_aux(int y, int x, int dir)
+static bool do_cmd_open_aux(int y, int x)
 {
        int i, j;
 
        cave_type *c_ptr;
+        byte feat;
 
        bool more = FALSE;
 
@@ -1089,8 +1090,11 @@ static bool do_cmd_open_aux(int y, int x, int dir)
        /* Get requested grid */
        c_ptr = &cave[y][x];
 
+        /* Feature code (applying "mimic" field) */
+        feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+                
        /* Jammed door */
-       if (c_ptr->feat >= FEAT_DOOR_HEAD + 0x08)
+       if (feat >= FEAT_DOOR_HEAD + 0x08)
        {
                /* Stuck */
 #ifdef JP
@@ -1102,7 +1106,7 @@ static bool do_cmd_open_aux(int y, int x, int dir)
        }
 
        /* Locked door */
-       else if (c_ptr->feat >= FEAT_DOOR_HEAD + 0x01)
+       else if (feat >= FEAT_DOOR_HEAD + 0x01)
        {
                /* Disarm factor */
                i = p_ptr->skill_dis;
@@ -1193,8 +1197,6 @@ void do_cmd_open(void)
 
        s16b o_idx;
 
-       cave_type *c_ptr;
-
        bool more = FALSE;
 
        if (p_ptr->special_defense & KATA_MUSOU)
@@ -1242,6 +1244,9 @@ void do_cmd_open(void)
        /* Get a "repeated" direction */
        if (get_rep_dir(&dir, TRUE))
        {
+                byte feat;
+                cave_type *c_ptr;
+
                /* Get requested location */
                y = py + ddy[dir];
                x = px + ddx[dir];
@@ -1249,12 +1254,14 @@ void do_cmd_open(void)
                /* Get requested grid */
                c_ptr = &cave[y][x];
 
+                /* Feature code (applying "mimic" field) */
+                feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+                
                /* Check for chest */
                o_idx = chest_check(y, x);
 
                /* Nothing useful */
-               if (!(is_closed_door(c_ptr->feat) && !c_ptr->mimic) &&
-                    !o_idx)
+               if (!is_closed_door(feat) && !o_idx)
                {
                        /* Message */
 #ifdef JP
@@ -1294,7 +1301,7 @@ void do_cmd_open(void)
                else
                {
                        /* Open the door */
-                       more = do_cmd_open_aux(y, x, dir);
+                       more = do_cmd_open_aux(y, x);
                }
        }
 
@@ -1313,9 +1320,10 @@ void do_cmd_open(void)
  *
  * Returns TRUE if repeated commands may continue
  */
-static bool do_cmd_close_aux(int y, int x, int dir)
+static bool do_cmd_close_aux(int y, int x)
 {
        cave_type       *c_ptr;
+        byte feat;
 
        bool            more = FALSE;
 
@@ -1326,8 +1334,11 @@ static bool do_cmd_close_aux(int y, int x, int dir)
        /* Get grid and contents */
        c_ptr = &cave[y][x];
 
+        /* Feature code (applying "mimic" field) */
+        feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+                
        /* Broken door */
-       if (c_ptr->feat == FEAT_BROKEN)
+       if (feat == FEAT_BROKEN)
        {
                /* Message */
 #ifdef JP
@@ -1363,8 +1374,6 @@ void do_cmd_close(void)
 {
        int y, x, dir;
 
-       cave_type *c_ptr;
-
        bool more = FALSE;
 
        if (p_ptr->special_defense & KATA_MUSOU)
@@ -1402,6 +1411,9 @@ void do_cmd_close(void)
        /* Get a "repeated" direction */
        if (get_rep_dir(&dir,FALSE))
        {
+                cave_type *c_ptr;
+                byte feat;
+
                /* Get requested location */
                y = py + ddy[dir];
                x = px + ddx[dir];
@@ -1409,12 +1421,15 @@ void do_cmd_close(void)
                /* Get grid and contents */
                c_ptr = &cave[y][x];
 
+                /* Feature code (applying "mimic" field) */
+                feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+                
                /* Require open/broken door */
-               if ((c_ptr->feat != FEAT_OPEN) && (c_ptr->feat != FEAT_BROKEN))
+               if ((feat != FEAT_OPEN) && (feat != FEAT_BROKEN))
                {
                        /* Message */
 #ifdef JP
-               msg_print("¤½¤³¤Ë¤ÏÊĤ¸¤ë¤â¤Î¤¬¸«Åö¤¿¤é¤Ê¤¤¡£");
+                        msg_print("¤½¤³¤Ë¤ÏÊĤ¸¤ë¤â¤Î¤¬¸«Åö¤¿¤é¤Ê¤¤¡£");
 #else
                        msg_print("You see nothing there to close.");
 #endif
@@ -1443,7 +1458,7 @@ void do_cmd_close(void)
                else
                {
                        /* Close the door */
-                       more = do_cmd_close_aux(y, x, dir);
+                       more = do_cmd_close_aux(y, x);
                }
        }
 
@@ -1534,7 +1549,7 @@ static bool twall(int y, int x, byte feat)
  *
  * Returns TRUE if repeated commands may continue
  */
-static bool do_cmd_tunnel_aux(int y, int x, int dir)
+static bool do_cmd_tunnel_aux(int y, int x)
 {
        cave_type *c_ptr;
        byte feat;
@@ -1929,7 +1944,7 @@ void do_cmd_tunnel(void)
                else
                {
                        /* Tunnel through walls */
-                       more = do_cmd_tunnel_aux(y, x, dir);
+                       more = do_cmd_tunnel_aux(y, x);
                }
        }
 
@@ -2240,9 +2255,7 @@ static bool do_cmd_disarm_aux(int y, int x, int dir)
                c_ptr->info &= ~(CAVE_MARK);
 
                /* Remove the trap */
-               c_ptr->feat = floor_type[randint0(100)];
-               note_spot(y, x);
-               lite_spot(y, x);
+                cave_set_feat(y, x, floor_type[randint0(100)]);
 
 #ifdef ALLOW_EASY_DISARM /* TNB */
 
@@ -2313,8 +2326,6 @@ void do_cmd_disarm(void)
 
        s16b o_idx;
 
-       cave_type *c_ptr;
-
        bool more = FALSE;
 
        if (p_ptr->special_defense & KATA_MUSOU)
@@ -2362,6 +2373,9 @@ void do_cmd_disarm(void)
        /* Get a direction (or abort) */
        if (get_rep_dir(&dir,TRUE))
        {
+                cave_type *c_ptr;
+                byte feat;
+
                /* Get location */
                y = py + ddy[dir];
                x = px + ddx[dir];
@@ -2369,15 +2383,18 @@ void do_cmd_disarm(void)
                /* Get grid and contents */
                c_ptr = &cave[y][x];
 
+                /* Feature code (applying "mimic" field) */
+                feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
                /* Check for chests */
                o_idx = chest_check(y, x);
 
                /* Disarm a trap */
-               if (!is_trap(c_ptr->feat) && !o_idx)
+               if (!is_trap(feat) && !o_idx)
                {
                        /* Message */
 #ifdef JP
-               msg_print("¤½¤³¤Ë¤Ï²ò½ü¤¹¤ë¤â¤Î¤¬¸«Åö¤¿¤é¤Ê¤¤¡£");
+                        msg_print("¤½¤³¤Ë¤Ï²ò½ü¤¹¤ë¤â¤Î¤¬¸«Åö¤¿¤é¤Ê¤¤¡£");
 #else
                        msg_print("You see nothing there to disarm.");
 #endif
@@ -2580,6 +2597,8 @@ void do_cmd_bash(void)
        /* Get a "repeated" direction */
        if (get_rep_dir(&dir,FALSE))
        {
+                byte feat;
+
                /* Bash location */
                y = py + ddy[dir];
                x = px + ddx[dir];
@@ -2587,9 +2606,12 @@ void do_cmd_bash(void)
                /* Get grid */
                c_ptr = &cave[y][x];
 
+                /* Feature code (applying "mimic" field) */
+                feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
                /* Nothing useful */
-               if (!((c_ptr->feat >= FEAT_DOOR_HEAD) &&
-                     (c_ptr->feat <= FEAT_DOOR_TAIL)))
+               if (!((feat >= FEAT_DOOR_HEAD) &&
+                     (feat <= FEAT_DOOR_TAIL)))
                {
                        /* Message */
 #ifdef JP
@@ -2671,6 +2693,8 @@ void do_cmd_alter(void)
        /* Get a direction */
        if (get_rep_dir(&dir,TRUE))
        {
+                byte feat;
+
                /* Get location */
                y = py + ddy[dir];
                x = px + ddx[dir];
@@ -2678,6 +2702,9 @@ void do_cmd_alter(void)
                /* Get grid */
                c_ptr = &cave[y][x];
 
+                /* Feature code (applying "mimic" field) */
+                feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
                /* Take a turn */
                energy_use = 100;
 
@@ -2689,24 +2716,18 @@ void do_cmd_alter(void)
                }
 
                /* Tunnel through walls */
-               else if (((c_ptr->feat >= FEAT_RUBBLE) &&
-                         (c_ptr->feat < FEAT_MINOR_GLYPH)) ||
-                        ((c_ptr->feat == FEAT_TREES) ||
-                         (c_ptr->feat == FEAT_MOUNTAIN)))
+               else if (((feat >= FEAT_RUBBLE) &&
+                         (feat < FEAT_MINOR_GLYPH)) ||
+                        ((feat == FEAT_TREES) ||
+                         (feat == FEAT_MOUNTAIN)))
                {
-                       more = do_cmd_tunnel_aux(y, x, dir);
+                       more = do_cmd_tunnel_aux(y, x);
                }
 
-                else if (is_closed_door(c_ptr->feat))
+                else if (is_closed_door(feat))
                 {
-                        /* Tunnel hidden door */
-                        if (c_ptr->mimic)
-                        {
-                                more = do_cmd_tunnel_aux(y, x, dir);
-                        }
-
                         /* Bash jammed doors */
-                        else if (c_ptr->feat >= FEAT_DOOR_HEAD + 0x08)
+                        if (feat >= FEAT_DOOR_HEAD + 0x08)
                         {
                                 more = do_cmd_bash_aux(y, x, dir);
                         }
@@ -2714,19 +2735,19 @@ void do_cmd_alter(void)
                         /* Locked doors */
                         else
                         {
-                                more = do_cmd_open_aux(y, x, dir);
+                                more = do_cmd_open_aux(y, x);
                         }
                 }
 
                /* Close open doors */
-               else if ((c_ptr->feat == FEAT_OPEN) ||
-                        (c_ptr->feat == FEAT_BROKEN))
+               else if ((feat == FEAT_OPEN) ||
+                        (feat == FEAT_BROKEN))
                {
-                       more = do_cmd_close_aux(y, x, dir);
+                       more = do_cmd_close_aux(y, x);
                }
 
                /* Disarm traps */
-               else if (is_trap(c_ptr->feat))
+               else if (is_trap(feat))
                {
                        more = do_cmd_disarm_aux(y, x, dir);
                }
@@ -2789,10 +2810,7 @@ static bool get_spike(int *ip)
  */
 void do_cmd_spike(void)
 {
-       int y, x, dir, item;
-
-       cave_type *c_ptr;
-
+       int dir;
 
        if (p_ptr->special_defense & KATA_MUSOU)
        {
@@ -2802,6 +2820,10 @@ void do_cmd_spike(void)
        /* Get a "repeated" direction */
        if (get_rep_dir(&dir,FALSE))
        {
+                int y, x, item;
+                cave_type *c_ptr;
+                byte feat;
+
                /* Get location */
                y = py + ddy[dir];
                x = px + ddx[dir];
@@ -2809,9 +2831,12 @@ void do_cmd_spike(void)
                /* Get grid and contents */
                c_ptr = &cave[y][x];
 
+                /* Feature code (applying "mimic" field) */
+                feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
                /* Require closed door */
-               if (!((c_ptr->feat >= FEAT_DOOR_HEAD) &&
-                     (c_ptr->feat <= FEAT_DOOR_TAIL)))
+               if (!((feat >= FEAT_DOOR_HEAD) &&
+                     (feat <= FEAT_DOOR_TAIL)))
                {
                        /* Message */
 #ifdef JP
index 76a6b1b..854e494 100644 (file)
@@ -674,13 +674,11 @@ static bool cast_hissatsu_spell(int spell)
                cave[y][x].info &= ~(CAVE_MARK);
 
                /* Destroy the feature */
-               cave[y][x].feat = floor_type[randint0(100)];
+                cave_set_feat(y, x, floor_type[randint0(100)]);
 
                /* Update some things */
                p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
 
-               lite_spot(y, x);
-
                break;
        }
        case 13:
index 51d6778..fd8d348 100644 (file)
@@ -3156,11 +3156,8 @@ msg_print("
                        /* Forget the wall */
                        c_ptr->info &= ~(CAVE_MARK);
 
-                        /* Clear garbage of hidden trap or door */
-                        c_ptr->mimic = 0;
-
                        /* Notice */
-                       c_ptr->feat = floor_type[randint0(100)];
+                        cave_set_feat(ny, nx, floor_type[randint0(100)]);
 
                        /* Note changes to viewable region */
                        if (player_has_los_bold(ny, nx)) do_view = TRUE;
@@ -3472,7 +3469,8 @@ msg_print("
                        {
                                if (r_ptr->flags2 & RF2_KILL_WALL)
                                {
-                                       c_ptr->feat = FEAT_GRASS;
+                                        cave_set_feat(ny, nx, FEAT_GRASS);
+
                                }
                                if (!(r_ptr->flags7 & RF7_CAN_FLY) && !(r_ptr->flags8 & RF8_WILD_WOOD))
                                {
index 37cad1e..ddd94ea 100644 (file)
@@ -665,7 +665,7 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
 #else
                        msg_format("A tree %s", message);
 #endif
-                       c_ptr->feat = (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS);
+                       cave_set_feat(y, x, (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS));
 
                        /* Observe */
                        if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
@@ -874,7 +874,7 @@ msg_print("
                                c_ptr->info &= ~(CAVE_MARK);
 
                                /* Destroy the wall */
-                               c_ptr->feat = floor_type[randint0(100)];
+                                cave_set_feat(y, x, floor_type[randint0(100)]);
                        }
 
                        /* Quartz / Magma with treasure */
@@ -898,7 +898,7 @@ msg_print("
                                c_ptr->info &= ~(CAVE_MARK);
 
                                /* Destroy the wall */
-                               c_ptr->feat = floor_type[randint0(100)];
+                                cave_set_feat(y, x, floor_type[randint0(100)]);
 
                                /* Place some gold */
                                place_gold(y, x);
@@ -923,7 +923,7 @@ msg_print("
                                c_ptr->info &= ~(CAVE_MARK);
 
                                /* Destroy the wall */
-                               c_ptr->feat = floor_type[randint0(100)];
+                                cave_set_feat(y, x, floor_type[randint0(100)]);
                        }
 
                        /* Rubble */
@@ -945,7 +945,7 @@ msg_print("
                                c_ptr->info &= ~(CAVE_MARK);
 
                                /* Destroy the rubble */
-                               c_ptr->feat = floor_type[randint0(100)];
+                                cave_set_feat(y, x, floor_type[randint0(100)]);
 
                                /* Hack -- place an object */
                                if (randint0(100) < 10)
@@ -986,7 +986,7 @@ msg_print("
                                c_ptr->info &= ~(CAVE_MARK);
 
                                /* Destroy the feature */
-                               c_ptr->feat = floor_type[randint0(100)];
+                                cave_set_feat(y, x, floor_type[randint0(100)]);
                        }
 
                        /* Notice */
@@ -8033,9 +8033,7 @@ void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte
                                                        if (cave[y][x].feat == FEAT_TREES)
                                                                cave_set_feat(y, x, FEAT_GRASS);
                                                        else
-                                                       {
-                                                               cave[y][x].feat = floor_type[randint0(100)];
-                                                       }
+                                                                cave_set_feat(y, x, floor_type[randint0(100)]);
                                                }
                                                /* Update some things -- similar to GF_KILL_WALL */
                                                p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
@@ -8818,9 +8816,7 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons
                                                                if (cave[y][x].feat == FEAT_TREES)
                                                                        cave_set_feat(y, x, FEAT_GRASS);
                                                                else
-                                                               {
-                                                                       cave[y][x].feat = floor_type[randint0(100)];
-                                                               }
+                                                                        cave_set_feat(y, x, floor_type[randint0(100)]);
                                                        }
 
                                                        /* Update some things -- similar to GF_KILL_WALL */
index f9a1254..3a7a9b2 100644 (file)
@@ -5324,9 +5324,6 @@ bool destroy_area(int y1, int x1, int r, int full)
                        /* Lose room and vault */
                        c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE | CAVE_OBJECT);
 
-                        /* Clear mimic type */
-                        c_ptr->mimic = 0;
-
                        /* Lose light and knowledge */
                        c_ptr->info &= ~(CAVE_MARK | CAVE_GLOW);
 
@@ -5402,28 +5399,28 @@ bool destroy_area(int y1, int x1, int r, int full)
                                if (t < 20)
                                {
                                        /* Create granite wall */
-                                       c_ptr->feat = FEAT_WALL_EXTRA;
+                                        cave_set_feat(y, x, FEAT_WALL_EXTRA);
                                }
 
                                /* Quartz */
                                else if (t < 70)
                                {
                                        /* Create quartz vein */
-                                       c_ptr->feat = FEAT_QUARTZ;
+                                        cave_set_feat(y, x, FEAT_QUARTZ);
                                }
 
                                /* Magma */
                                else if (t < 100)
                                {
                                        /* Create magma vein */
-                                       c_ptr->feat = FEAT_MAGMA;
+                                        cave_set_feat(y, x, FEAT_MAGMA);
                                }
 
                                /* Floor */
                                else
                                {
                                        /* Create floor */
-                                       c_ptr->feat = floor_type[randint0(100)];
+                                        cave_set_feat(y, x, floor_type[randint0(100)]);
                                }
                        }
                }
@@ -5900,9 +5897,6 @@ msg_format("%^s
                                /* Delete objects */
                                delete_object(yy, xx);
 
-                                /* Clear mimic type */
-                                c_ptr->mimic = 0;
-
                                 /* Clear mirror, runes flag */
                                 c_ptr->info &= ~CAVE_OBJECT;
 
@@ -5913,28 +5907,28 @@ msg_format("%^s
                                if (t < 20)
                                {
                                        /* Create granite wall */
-                                       c_ptr->feat = FEAT_WALL_EXTRA;
+                                        cave_set_feat(y, x, FEAT_WALL_EXTRA);
                                }
 
                                /* Quartz */
                                else if (t < 70)
                                {
                                        /* Create quartz vein */
-                                       c_ptr->feat = FEAT_QUARTZ;
+                                        cave_set_feat(y, x, FEAT_QUARTZ);
                                }
 
                                /* Magma */
                                else if (t < 100)
                                {
                                        /* Create magma vein */
-                                       c_ptr->feat = FEAT_MAGMA;
+                                        cave_set_feat(y, x, FEAT_MAGMA);
                                }
 
                                /* Floor */
                                else
                                {
                                        /* Create floor */
-                                       c_ptr->feat = floor_type[randint0(100)];
+                                        cave_set_feat(y, x, floor_type[randint0(100)]);
                                }
                        }
                }
index d690bc2..b2a210f 100644 (file)
@@ -116,6 +116,9 @@ static void recursive_river(int x1, int y1, int x2, int y2, int feat1, int feat2
                                                else
                                                        c_ptr->feat = feat1;
 
+                                                /* Clear garbage of hidden trap or door */
+                                                c_ptr->mimic = 0;
+
                                                /* Lava terrain glows */
                                                if ((feat1 == FEAT_DEEP_LAVA) ||  (feat1 == FEAT_SHAL_LAVA))
                                                {
@@ -258,6 +261,9 @@ void build_streamer(int feat, int chance)
                        /* Clear previous contents, add proper vein type */
                        c_ptr->feat = feat;
 
+                        /* Paranoia: Clear mimic field */
+                        c_ptr->mimic = 0;
+
                        /* Hack -- Add some (known) treasure */
                        if (treasure && one_in_(chance)) c_ptr->feat += 0x04;
                }
@@ -324,7 +330,7 @@ void place_trees(int x, int y)
                                        cave[j][i].feat = FEAT_RUBBLE;
                                }
 
-                                /* Clear possible garbage of hidden trap or door */
+                                /* Clear garbage of hidden trap or door */
                                 c_ptr->mimic = 0;
 
                                /* Light area since is open above */
@@ -423,6 +429,9 @@ if (cheat_room) msg_print("
                                                place_floor_grid(c_ptr);
                                        }
 
+                                        /* Clear garbage of hidden trap or door */
+                                        c_ptr->mimic = 0;
+
                                        /* No longer part of a room or vault */
                                        c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);