OSDN Git Service

[Refactor] #38997 remove_mirror() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 07:02:53 +0000 (16:02 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 07:02:53 +0000 (16:02 +0900)
src/grid.c
src/grid.h
src/spells1.c
src/spells2.c

index 93a9f86..bf1aea4 100644 (file)
@@ -1094,21 +1094,21 @@ void cave_alter_feat(POSITION y, POSITION x, int action)
 
 
 /* Remove a mirror */
-void remove_mirror(POSITION y, POSITION x)
+void remove_mirror(player_type *caster_ptr, POSITION y, POSITION x)
 {
-       grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+       grid_type *g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
 
        /* Remove the mirror */
        g_ptr->info &= ~(CAVE_OBJECT);
        g_ptr->mimic = 0;
 
-       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
+       if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
        {
                g_ptr->info &= ~(CAVE_GLOW);
                if (!view_torch_grids) g_ptr->info &= ~(CAVE_MARK);
-               if (g_ptr->m_idx) update_monster(p_ptr, g_ptr->m_idx, FALSE);
+               if (g_ptr->m_idx) update_monster(caster_ptr, g_ptr->m_idx, FALSE);
 
-               update_local_illumination(p_ptr, y, x);
+               update_local_illumination(caster_ptr, y, x);
        }
 
        note_spot(y, x);
index c5e3b62..99f74c5 100644 (file)
@@ -396,7 +396,7 @@ extern void delayed_visual_update(void);
 extern void update_flow(player_type *subject_ptr);
 extern FEAT_IDX feat_state(FEAT_IDX feat, int action);
 extern void cave_alter_feat(POSITION y, POSITION x, int action);
-extern void remove_mirror(POSITION y, POSITION x);
+extern void remove_mirror(player_type *caster_ptr, POSITION y, POSITION x);
 extern bool is_open(FEAT_IDX feat);
 extern bool check_local_illumination(player_type *creature_ptr, POSITION y, POSITION x);
 
index 69a3c50..1d97a1d 100644 (file)
@@ -657,7 +657,7 @@ static bool project_f(floor_type *floor_ptr, MONSTER_IDX who, POSITION r, POSITI
                        {
                                msg_print(_("鏡が割れた!", "The mirror was crashed!"));
                                sound(SOUND_GLASS);
-                               remove_mirror(y, x);
+                               remove_mirror(p_ptr, y, x);
                                project(p_ptr, 0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
                        }
 
@@ -682,7 +682,7 @@ static bool project_f(floor_type *floor_ptr, MONSTER_IDX who, POSITION r, POSITI
                        {
                                msg_print(_("鏡が割れた!", "The mirror was crashed!"));
                                sound(SOUND_GLASS);
-                               remove_mirror(y, x);
+                               remove_mirror(p_ptr, y, x);
                                project(p_ptr, 0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
                        }
 
@@ -705,7 +705,7 @@ static bool project_f(floor_type *floor_ptr, MONSTER_IDX who, POSITION r, POSITI
                {
                        /* Destroy mirror/glyph */
                        if (is_mirror_grid(g_ptr) || is_glyph_grid(g_ptr) || is_explosive_rune_grid(g_ptr))
-                               remove_mirror(y, x);
+                               remove_mirror(p_ptr, y, x);
 
                        /* Permanent features don't get effect */
                        /* But not protect monsters and other objects */
@@ -5802,7 +5802,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                                monster_target_y = y;
                                monster_target_x = x;
 
-                               remove_mirror(y, x);
+                               remove_mirror(caster_ptr, y, x);
                                next_mirror(caster_ptr, &oy, &ox, y, x);
 
                                path_n = i + project_path(caster_ptr->current_floor_ptr, &(path_g[i + 1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
@@ -5939,7 +5939,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                                monster_target_y = y;
                                monster_target_x = x;
 
-                               remove_mirror(y, x);
+                               remove_mirror(caster_ptr, y, x);
                                for (j = 0; j <= i; j++)
                                {
                                        y = GRID_Y(path_g[j]);
@@ -6742,7 +6742,7 @@ bool binding_field(player_type *caster_ptr, HIT_POINT dam)
        }
        if (one_in_(7)) {
                msg_print(_("鏡が結界に耐えきれず、壊れてしまった。", "The field broke a mirror"));
-               remove_mirror(point_y[0], point_x[0]);
+               remove_mirror(caster_ptr, point_y[0], point_x[0]);
        }
 
        return TRUE;
@@ -6768,7 +6768,7 @@ void seal_of_mirror(player_type *caster_ptr, HIT_POINT dam)
                                {
                                        if (!caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
                                        {
-                                               remove_mirror(y, x);
+                                               remove_mirror(caster_ptr, y, x);
                                        }
                                }
                        }
index bba37f5..a21319d 100644 (file)
@@ -3117,7 +3117,7 @@ void remove_all_mirrors(player_type *caster_ptr, bool explode)
                {
                        if (is_mirror_grid(&caster_ptr->current_floor_ptr->grid_array[y][x]))
                        {
-                               remove_mirror(y, x);
+                               remove_mirror(caster_ptr, y, x);
                                if (explode)
                                        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);