OSDN Git Service

[Refactor] #38997 map_area() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Wed, 11 Dec 2019 10:02:01 +0000 (19:02 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 11 Dec 2019 10:02:01 +0000 (19:02 +0900)
13 files changed:
src/cmd/cmd-activate.c
src/cmd/cmd-read.c
src/cmd/cmd-usestaff.c
src/cmd/cmd-zaprod.c
src/mind.c
src/realm-daemon.c
src/realm-life.c
src/realm-nature.c
src/realm-song.c
src/realm-sorcery.c
src/spells-floor.c
src/spells-floor.h
src/wizard2.c

index ede9277..09f2041 100644 (file)
@@ -1441,7 +1441,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_MAP_LIGHT:
        {
                msg_print(_("眩しく輝いた...", "It shines brightly..."));
-               map_area(DETECT_RAD_MAP);
+               map_area(user_ptr, DETECT_RAD_MAP);
                lite_area(damroll(2, 15), 3);
                break;
        }
index 45ad833..e871e56 100644 (file)
@@ -282,7 +282,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known)
 
                case SV_SCROLL_MAPPING:
                {
-                       map_area(DETECT_RAD_MAP);
+                       map_area(creature_ptr, DETECT_RAD_MAP);
                        ident = TRUE;
                        break;
                }
index 4e2df73..b764b9e 100644 (file)
@@ -114,7 +114,7 @@ int staff_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use
 
                case SV_STAFF_MAPPING:
                {
-                       map_area(powerful ? DETECT_RAD_MAP * 3 / 2 : DETECT_RAD_MAP);
+                       map_area(creature_ptr, powerful ? DETECT_RAD_MAP * 3 / 2 : DETECT_RAD_MAP);
                        ident = TRUE;
                        break;
                }
index c9d2a07..c22c5ee 100644 (file)
@@ -78,7 +78,7 @@ int rod_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d
 
        case SV_ROD_MAPPING:
        {
-               map_area(powerful ? DETECT_RAD_MAP * 3 / 2 : DETECT_RAD_MAP);
+               map_area(creature_ptr, powerful ? DETECT_RAD_MAP * 3 / 2 : DETECT_RAD_MAP);
                ident = TRUE;
                break;
        }
index 8a3b032..f772097 100644 (file)
@@ -1042,7 +1042,7 @@ static bool cast_mindcrafter_spell(player_type *caster_ptr, int spell)
                        wiz_lite(caster_ptr, FALSE);
                }
                else if (plev > 19)
-                       map_area(DETECT_RAD_MAP);
+                       map_area(caster_ptr, DETECT_RAD_MAP);
 
                if (plev < 30)
                {
@@ -1328,7 +1328,7 @@ static bool cast_mirror_spell(player_type *caster_ptr, int spell)
                if (plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
                if (plev + tmp > 18)detect_monsters_invis(DETECT_RAD_DEFAULT);
                if (plev + tmp > 28)set_tim_esp(caster_ptr, (TIME_EFFECT)plev, FALSE);
-               if (plev + tmp > 38)map_area(DETECT_RAD_MAP);
+               if (plev + tmp > 38)map_area(caster_ptr, DETECT_RAD_MAP);
                if (tmp == 0 && plev < 5) {
                        msg_print(_("鏡がなくて集中できなかった!", "You need a mirror to concentrate!"));
                }
index a76265d..3c2d909 100644 (file)
@@ -210,7 +210,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               map_area(rad);
+                               map_area(caster_ptr, rad);
                        }
                }
                break;
index 8af9d9f..84a12ba 100644 (file)
@@ -203,7 +203,7 @@ concptr do_life_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               map_area(rad);
+                               map_area(caster_ptr, rad);
                        }
                }
                break;
index 068a839..58080ff 100644 (file)
@@ -238,7 +238,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               map_area(rad1);
+                               map_area(caster_ptr, rad1);
                                detect_traps(rad2, TRUE);
                                detect_doors(rad2);
                                detect_stairs(rad2);
index 7ffda85..e43e25d 100644 (file)
@@ -286,7 +286,7 @@ concptr do_music_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                                if (count >= 19) wiz_lite(p_ptr, FALSE);
                                if (count >= 11)
                                {
-                                       map_area(rad);
+                                       map_area(caster_ptr, rad);
                                        if (plev > 39 && count < 19)
                                                SINGING_COUNT(caster_ptr) = count + 1;
                                }
index 6ff0fe6..5ebe5d3 100644 (file)
@@ -176,7 +176,7 @@ concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                        if (cast)
                        {
-                               map_area(rad);
+                               map_area(caster_ptr, rad);
                        }
                }
                break;
index 186afbd..9156ef4 100644 (file)
@@ -387,7 +387,7 @@ void stair_creation(player_type *caster_ptr)
 /*
  * Hack -- map the current panel (plus some) ala "magic mapping"
  */
-void map_area(POSITION range)
+void map_area(player_type *caster_ptr, POSITION range)
 {
        int i;
        POSITION x, y;
@@ -395,16 +395,16 @@ void map_area(POSITION range)
        FEAT_IDX feat;
        feature_type *f_ptr;
 
-       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        /* Scan that area */
-       for (y = 1; y < p_ptr->current_floor_ptr->height - 1; y++)
+       for (y = 1; y < caster_ptr->current_floor_ptr->height - 1; y++)
        {
-               for (x = 1; x < p_ptr->current_floor_ptr->width - 1; x++)
+               for (x = 1; x < caster_ptr->current_floor_ptr->width - 1; x++)
                {
-                       if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
+                       if (distance(caster_ptr->y, caster_ptr->x, y, x) > range) continue;
 
-                       g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+                       g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
 
                        /* Memorize terrain of the grid */
                        g_ptr->info |= (CAVE_KNOWN);
@@ -426,7 +426,7 @@ void map_area(POSITION range)
                                /* Memorize known walls */
                                for (i = 0; i < 8; i++)
                                {
-                                       g_ptr = &p_ptr->current_floor_ptr->grid_array[y + ddy_ddd[i]][x + ddx_ddd[i]];
+                                       g_ptr = &caster_ptr->current_floor_ptr->grid_array[y + ddy_ddd[i]][x + ddx_ddd[i]];
 
                                        /* Feature code (applying "mimic" field) */
                                        feat = get_feat_mimic(g_ptr);
@@ -443,8 +443,8 @@ void map_area(POSITION range)
                }
        }
 
-       p_ptr->redraw |= (PR_MAP);
-       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+       caster_ptr->redraw |= (PR_MAP);
+       caster_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 }
 
 
index 3c5744e..6baae40 100644 (file)
@@ -6,6 +6,6 @@ extern bool warding_glyph(player_type *caster_ptr);
 extern bool explosive_rune(floor_type *floor_ptr, POSITION y, POSITION x);
 extern bool place_mirror(player_type *caster_ptr);
 extern void stair_creation(player_type *caster_ptr);
-extern void map_area(POSITION range);
+extern void map_area(player_type *caster_ptr, POSITION range);
 extern bool destroy_area(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION r, bool in_generate);
 extern bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx);
index 93af6d7..4c3b089 100644 (file)
@@ -1878,7 +1878,7 @@ void do_cmd_debug(player_type *creature_ptr)
 
        /* Magic Mapping */
        case 'm':
-               map_area(DETECT_RAD_ALL * 3);
+               map_area(creature_ptr, DETECT_RAD_ALL * 3);
                break;
 
        /* Mutation */