OSDN Git Service

隠しドアを隠せない地形で隠しドアを潰す判定をMOVE || CAN_FLYとした. 潰
[hengband/hengband.git] / src / grid.c
index 5e706fc..f59c8fb 100644 (file)
@@ -37,7 +37,7 @@ bool new_player_spot(void)
 
                /* Must be a "naked" floor grid */
                if (c_ptr->m_idx) continue;
-               if (!have_flag(f_flags_grid(c_ptr), FF_MOVE) && !have_flag(f_flags_grid(c_ptr), FF_CAN_FLY)) continue;
+               if (!have_flag(f_flags_grid(c_ptr), FF_MOVE)) continue;
                if (!player_can_enter(c_ptr->feat, 0)) continue;
                if (!in_bounds(y, x)) continue;
 
@@ -152,7 +152,10 @@ void place_random_door(int y, int x, bool room)
                /* Floor type terrain cannot hide a door */
                if (feat_supports_los(c_ptr->mimic) && !feat_supports_los(c_ptr->feat))
                {
-                       if (have_flag(f_info[c_ptr->mimic].flags, FF_MOVE)) c_ptr->feat = c_ptr->mimic;
+                       if (have_flag(f_info[c_ptr->mimic].flags, FF_MOVE) || have_flag(f_info[c_ptr->mimic].flags, FF_CAN_FLY))
+                       {
+                               c_ptr->feat = one_in_(2) ? c_ptr->mimic : floor_type[randint0(100)];
+                       }
                        c_ptr->mimic = 0;
                }
        }
@@ -596,7 +599,7 @@ void build_tunnel(int row1, int col1, int row2, int col2)
                c_ptr = &cave[tmp_row][tmp_col];
                f_ptr = &f_info[c_ptr->feat];
 
-               if (have_flag(f_ptr->flags, FF_WALL) && have_flag(f_ptr->flags, FF_PERMANENT))
+               if (permanent_wall(f_ptr))
                {
                        /* Avoid the edge of vaults */
                        if (is_inner_grid(c_ptr)) continue;
@@ -738,15 +741,6 @@ static bool set_tunnel(int *x, int *y, bool affectwall)
        feat = c_ptr->feat;
        f_ptr = &f_info[feat];
 
-       if (have_flag(f_ptr->flags, FF_WALL) && have_flag(f_ptr->flags, FF_PERMANENT))
-       {
-               /*
-                * Ignore permanent walls - sometimes cannot tunnel around them anyway
-                * so don't try - it just complicates things unnecessarily.
-                */
-               return TRUE;
-       }
-
        if (is_inner_grid(c_ptr))
        {
                return TRUE;