OSDN Git Service

[Refactor] #38997 cave_empty_bold() に floor_type * 引数を追加. / Add floor_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Tue, 12 Nov 2019 01:20:09 +0000 (10:20 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 12 Nov 2019 01:20:09 +0000 (10:20 +0900)
14 files changed:
src/chest.c
src/combat/shoot.c
src/floor-save.c
src/floor.h
src/mind.c
src/monster2.c
src/mspells1.c
src/mspells4.c
src/realm-hex.c
src/realm-hissatsu.c
src/spells-floor.c
src/spells2.c
src/spells3.c
src/wizard2.c

index 09579d3..53f0456 100644 (file)
@@ -99,7 +99,7 @@ void chest_death(bool scatter, POSITION y, POSITION x, OBJECT_IDX o_idx)
                                x = randint0(MAX_WID);
 
                                /* Must be an empty floor. */
-                               if (!cave_empty_bold(y, x)) continue;
+                               if (!cave_empty_bold(p_ptr->current_floor_ptr, y, x)) continue;
 
                                /* Place the object there. */
                                (void)drop_near(q_ptr, -1, y, x);
index 70d4e38..bd9395c 100644 (file)
@@ -799,7 +799,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
                                                                if (!player_can_enter(shooter_ptr->current_floor_ptr->grid_array[ny][nx].feat, 0)) break;
 
                                                                /* Stopped by monsters */
-                                                               if (!cave_empty_bold(ny, nx)) break;
+                                                               if (!cave_empty_bold(p_ptr->current_floor_ptr, ny, nx)) break;
 
                                                                shooter_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
                                                                shooter_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
index 5d25d84..f7875b6 100644 (file)
@@ -728,7 +728,7 @@ static void get_out_monster(floor_type *floor_ptr, player_type *protected_ptr)
                if (!in_bounds(floor_ptr, ny, nx)) continue;
 
                /* Require "empty" floor space */
-               if (!cave_empty_bold(ny, nx)) continue;
+               if (!cave_empty_bold(p_ptr->current_floor_ptr, ny, nx)) continue;
 
                /* Hack -- no teleport onto glyph of warding */
                if (is_glyph_grid(&floor_ptr->grid_array[ny][nx])) continue;
index 7f69d72..3d75cd7 100644 (file)
@@ -261,9 +261,9 @@ extern floor_type floor_info;
  * Line 2 -- forbid normal monsters
  * Line 3 -- forbid the player
  */
-#define cave_empty_bold(Y,X) \
+#define cave_empty_bold(F,Y,X) \
        (cave_have_flag_bold((Y), (X), FF_PLACE) && \
-        !(p_ptr->current_floor_ptr->grid_array[Y][X].m_idx) && \
+        !((F)->grid_array[Y][X].m_idx) && \
         !player_bold(p_ptr, Y,X))
 
 
@@ -275,7 +275,7 @@ extern floor_type floor_info;
  * Line 2 -- forbid trees while dungeon generation
  */
 #define cave_empty_bold2(Y,X) \
-       (cave_empty_bold(Y,X) && \
+       (cave_empty_bold(p_ptr->current_floor_ptr, Y,X) && \
         (current_world_ptr->character_dungeon || !cave_have_flag_bold((Y), (X), FF_TREE)))
 
 
@@ -302,7 +302,7 @@ extern floor_type floor_info;
 
 
 /*
- * Grid based version of "cave_empty_bold()"
+ * Grid based version of "cave_empty_bold(p_ptr->current_floor_ptr, )"
  */
 #define cave_empty_grid(C) \
        (cave_have_flag_grid((C), FF_PLACE) && \
index 599e134..4c2f2f3 100644 (file)
@@ -1659,7 +1659,7 @@ static bool cast_ninja_spell(player_type *caster_ptr, int spell)
                        POSITION nx = GRID_X(path_g[i]);
                        grid_type *g_ptr = &caster_ptr->current_floor_ptr->grid_array[ny][nx];
 
-                       if (in_bounds(caster_ptr->current_floor_ptr, ny, nx) && cave_empty_bold(ny, nx) &&
+                       if (in_bounds(caster_ptr->current_floor_ptr, ny, nx) && cave_empty_bold(p_ptr->current_floor_ptr, ny, nx) &&
                            !(g_ptr->info & CAVE_OBJECT) &&
                                !pattern_tile(ny, nx))
                        {
index 8dd2629..7746368 100644 (file)
@@ -3365,7 +3365,7 @@ bool alloc_monster(POSITION dis, BIT_FLAGS mode)
                }
                else
                {
-                       if (!cave_empty_bold(y, x)) continue;
+                       if (!cave_empty_bold(p_ptr->current_floor_ptr, y, x)) continue;
                }
 
                /* Accept far away grids */
@@ -4087,4 +4087,4 @@ int get_monster_crowd_number(MONSTER_IDX m_idx)
        }
 
        return count;
-}
\ No newline at end of file
+}
index 4c75094..c97cb8a 100644 (file)
@@ -398,7 +398,7 @@ bool summon_possible(POSITION y1, POSITION x1)
                        if (pattern_tile(y, x)) continue;
 
                        /* Require empty floor grid in line of projection */
-                       if (cave_empty_bold(y, x) && projectable(y1, x1, y, x) && projectable(y, x, y1, x1)) return (TRUE);
+                       if (cave_empty_bold(p_ptr->current_floor_ptr, y, x) && projectable(y1, x1, y, x) && projectable(y, x, y1, x1)) return (TRUE);
                }
        }
 
index 20558e4..9fe67c7 100644 (file)
@@ -3177,17 +3177,17 @@ MONSTER_NUMBER summon_NAZGUL(POSITION y, POSITION x, MONSTER_IDX m_idx)
 
        for (k = 0; k < 30; k++)
        {
-               if (!summon_possible(cy, cx) || !cave_empty_bold(cy, cx))
+               if (!summon_possible(cy, cx) || !cave_empty_bold(p_ptr->current_floor_ptr, cy, cx))
                {
                        int j;
                        for (j = 100; j > 0; j--)
                        {
                                scatter(&cy, &cx, y, x, 2, 0);
-                               if (cave_empty_bold(cy, cx)) break;
+                               if (cave_empty_bold(p_ptr->current_floor_ptr, cy, cx)) break;
                        }
                        if (!j) break;
                }
-               if (!cave_empty_bold(cy, cx)) continue;
+               if (!cave_empty_bold(p_ptr->current_floor_ptr, cy, cx)) continue;
 
                if (summon_named_creature(m_idx, cy, cx, MON_NAZGUL, mode))
                {
index 96f29f1..d8c0748 100644 (file)
@@ -1026,7 +1026,7 @@ concptr do_hex_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                                        if (p_ptr->current_floor_ptr->grid_array[dy][dx].m_idx) flag = TRUE;
                                }
 
-                               if (!cave_empty_bold(y, x) || (p_ptr->current_floor_ptr->grid_array[y][x].info & CAVE_ICKY) ||
+                               if (!cave_empty_bold(p_ptr->current_floor_ptr, y, x) || (p_ptr->current_floor_ptr->grid_array[y][x].info & CAVE_ICKY) ||
                                        (distance(y, x, caster_ptr->y, caster_ptr->x) > plev + 2))
                                {
                                        msg_print(_("そこには移動できない。", "Can not teleport to there."));
index 521619d..388a085 100644 (file)
@@ -311,7 +311,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                                {
                                        y += ddy[dir];
                                        x += ddx[dir];
-                                       if (cave_empty_bold(y, x))
+                                       if (cave_empty_bold(p_ptr->current_floor_ptr, y, x))
                                        {
                                                ty = y;
                                                tx = x;
index d16272a..4e73641 100644 (file)
@@ -815,7 +815,7 @@ bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, M
                        x = caster_ptr->x + ddx_ddd[i];
 
                        /* Skip non-empty grids */
-                       if (!cave_empty_bold(y, x)) continue;
+                       if (!cave_empty_bold(p_ptr->current_floor_ptr, y, x)) continue;
 
                        /* Important -- Skip "quake" grids */
                        if (map[16 + y - cy][16 + x - cx]) continue;
@@ -963,7 +963,7 @@ bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, M
                                                        x = xx + ddx_ddd[i];
 
                                                        /* Skip non-empty grids */
-                                                       if (!cave_empty_bold(y, x)) continue;
+                                                       if (!cave_empty_bold(p_ptr->current_floor_ptr, y, x)) continue;
 
                                                        /* Hack -- no safety on glyph of warding */
                                                        if (is_glyph_grid(&caster_ptr->current_floor_ptr->grid_array[y][x])) continue;
index 1e58004..59bcfe0 100644 (file)
@@ -3039,7 +3039,7 @@ bool rush_attack(bool *mdeath)
                int ny = GRID_Y(path_g[i]);
                int nx = GRID_X(path_g[i]);
 
-               if (cave_empty_bold(ny, nx) && player_can_enter(p_ptr->current_floor_ptr->grid_array[ny][nx].feat, 0))
+               if (cave_empty_bold(p_ptr->current_floor_ptr, ny, nx) && player_can_enter(p_ptr->current_floor_ptr->grid_array[ny][nx].feat, 0))
                {
                        ty = ny;
                        tx = nx;
index 06cbba5..92df8b4 100644 (file)
@@ -3402,7 +3402,7 @@ bool shock_power(void)
                        {
                                y += ddy[dir];
                                x += ddx[dir];
-                               if (cave_empty_bold(y, x))
+                               if (cave_empty_bold(p_ptr->current_floor_ptr, y, x))
                                {
                                        ty = y;
                                        tx = x;
index d81a3f2..a49a689 100644 (file)
@@ -101,7 +101,7 @@ static void do_cmd_summon_horde(void)
        while (--attempts)
        {
                scatter(&wy, &wx, p_ptr->y, p_ptr->x, 3, 0);
-               if (cave_empty_bold(wy, wx)) break;
+               if (cave_empty_bold(p_ptr->current_floor_ptr, wy, wx)) break;
        }
 
        (void)alloc_horde(wy, wx);