OSDN Git Service

[Refactor] #38997 remove_all_mirrors() に player_type * 引数を追加. / Add player_type ...
authordeskull <deskull@users.sourceforge.jp>
Mon, 16 Dec 2019 17:05:55 +0000 (02:05 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 16 Dec 2019 17:05:55 +0000 (02:05 +0900)
src/floor-save.c
src/racial.c
src/spells.h
src/spells2.c

index 038a9d0..b98aa10 100644 (file)
@@ -875,7 +875,7 @@ void leave_floor(player_type *creature_ptr)
        preserve_pet();
 
        /* Remove all mirrors without explosion */
-       remove_all_mirrors(FALSE);
+       remove_all_mirrors(creature_ptr, FALSE);
 
        if (creature_ptr->special_defense & NINJA_S_STEALTH) set_superstealth(creature_ptr, FALSE);
 
index d346acf..c50305e 100644 (file)
@@ -614,7 +614,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        if (command == -3)
                        {
                                /* Explode all mirrors */
-                               remove_all_mirrors(TRUE);
+                               remove_all_mirrors(creature_ptr, TRUE);
                        }
                        else if (command == -4)
                        {
index e612d30..86d61d4 100644 (file)
@@ -247,7 +247,7 @@ extern bool eat_magic(player_type *caster_ptr, int power);
 extern void discharge_minion(player_type *caster_ptr);
 extern bool kawarimi(bool success);
 extern bool rush_attack(player_type *attacker_ptr, bool *mdeath);
-extern void remove_all_mirrors(bool explode);
+extern void remove_all_mirrors(player_type *caster_ptr, bool explode);
 extern void ring_of_power(player_type *caster_ptr, DIRECTION dir);
 extern void wild_magic(player_type *caster_ptr, int spell);
 extern void cast_meteor(player_type *caster_ptr, HIT_POINT dam, POSITION rad);
index d6450ad..bac5df4 100644 (file)
@@ -3107,19 +3107,19 @@ bool rush_attack(player_type *attacker_ptr, bool *mdeath)
  * @param explode 爆発処理を伴うならばTRUE
  * @return なし
  */
-void remove_all_mirrors(bool explode)
+void remove_all_mirrors(player_type *caster_ptr, bool explode)
 {
        POSITION x, y;
 
-       for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
+       for (x = 0; x < caster_ptr->current_floor_ptr->width; x++)
        {
-               for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
+               for (y = 0; y < caster_ptr->current_floor_ptr->height; y++)
                {
-                       if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[y][x]))
+                       if (is_mirror_grid(&caster_ptr->current_floor_ptr->grid_array[y][x]))
                        {
                                remove_mirror(y, x);
                                if (explode)
-                                       project(p_ptr, 0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS,
+                                       project(caster_ptr, 0, 2, y, x, caster_ptr->lev / 2 + 5, GF_SHARDS,
                                                (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
                        }
                }