OSDN Git Service

[Refactor] #38997 cave_empty_bold2() に floor_type * 引数を追加. / Add floor_type * argumen...
authordeskull <deskull@users.sourceforge.jp>
Tue, 12 Nov 2019 01:22:10 +0000 (10:22 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 12 Nov 2019 01:22:10 +0000 (10:22 +0900)
src/floor.h
src/monster1.c
src/monster2.c
src/realm-crusade.c

index 3d75cd7..c2e8e85 100644 (file)
@@ -274,8 +274,8 @@ extern floor_type floor_info;
  * Line 1 -- forbid non-empty grids
  * Line 2 -- forbid trees while dungeon generation
  */
-#define cave_empty_bold2(Y,X) \
-       (cave_empty_bold(p_ptr->current_floor_ptr, Y,X) && \
+#define cave_empty_bold2(F,Y,X) \
+       (cave_empty_bold(F,Y,X) && \
         (current_world_ptr->character_dungeon || !cave_have_flag_bold((Y), (X), FF_TREE)))
 
 
index c31aa5d..5693b42 100644 (file)
@@ -2750,7 +2750,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                                do
                                {
                                        scatter(&wy, &wx, y, x, 20, 0);
-                               } while (!(in_bounds(p_ptr->current_floor_ptr, wy, wx) && cave_empty_bold2(wy, wx)) && --attempts);
+                               } while (!(in_bounds(p_ptr->current_floor_ptr, wy, wx) && cave_empty_bold2(p_ptr->current_floor_ptr, wy, wx)) && --attempts);
 
                                if (attempts > 0)
                                {
index 7746368..90a2670 100644 (file)
@@ -2926,7 +2926,7 @@ static bool mon_scatter(MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION
                        else
                        {
                                /* Walls and Monsters block flow */
-                               if (!cave_empty_bold2(ny, nx)) continue;
+                               if (!cave_empty_bold2(p_ptr->current_floor_ptr, ny, nx)) continue;
 
                                /* ... nor on the Pattern */
                                if (pattern_tile(ny, nx)) continue;
@@ -3032,7 +3032,7 @@ static bool place_monster_group(MONSTER_IDX who, POSITION y, POSITION x, MONRACE
                        scatter(&my, &mx, hy, hx, 4, 0);
 
                        /* Walls and Monsters block flow */
-                       if (!cave_empty_bold2(my, mx)) continue;
+                       if (!cave_empty_bold2(p_ptr->current_floor_ptr, my, mx)) continue;
 
                        /* Attempt to place another monster */
                        if (place_monster_one(who, my, mx, r_idx, mode))
@@ -3182,7 +3182,7 @@ bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_id
                        scatter(&ny, &nx, y, x, d, 0);
 
                        /* Require empty grids */
-                       if (!cave_empty_bold2(ny, nx)) continue;
+                       if (!cave_empty_bold2(p_ptr->current_floor_ptr, ny, nx)) continue;
                        get_mon_num_prep(place_monster_can_escort, get_monster_hook2(ny, nx));
 
                        /* Pick a random race */
@@ -3316,7 +3316,7 @@ bool alloc_guardian(bool def_val)
                        ox = randint1(p_ptr->current_floor_ptr->width - 4) + 2;
 
                        /* Is it a good spot ? */
-                       if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(p_ptr->current_floor_ptr->grid_array[oy][ox].feat, &r_info[guardian], 0))
+                       if (cave_empty_bold2(p_ptr->current_floor_ptr, oy, ox) && monster_can_cross_terrain(p_ptr->current_floor_ptr->grid_array[oy][ox].feat, &r_info[guardian], 0))
                        {
                                /* Place the guardian */
                                if (place_monster_aux(0, oy, ox, guardian, (PM_ALLOW_GROUP | PM_NO_KAGE | PM_NO_PET))) return TRUE;
@@ -3361,7 +3361,7 @@ bool alloc_monster(POSITION dis, BIT_FLAGS mode)
                /* Require empty floor grid (was "naked") */
                if (p_ptr->current_floor_ptr->dun_level)
                {
-                       if (!cave_empty_bold2(y, x)) continue;
+                       if (!cave_empty_bold2(p_ptr->current_floor_ptr, y, x)) continue;
                }
                else
                {
index 669987b..2f3af2c 100644 (file)
@@ -560,7 +560,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                                                scatter(&my, &mx, caster_ptr->y, caster_ptr->x, 4, 0);
 
                                                /* Require empty grids */
-                                               if (cave_empty_bold2(my, mx)) break;
+                                               if (cave_empty_bold2(p_ptr->current_floor_ptr, my, mx)) break;
                                        }
                                        if (attempt < 0) continue;
                                        summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));