OSDN Git Service

[Refactor] #38997 mitokohmon() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sat, 2 Nov 2019 09:44:43 +0000 (18:44 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 2 Nov 2019 09:44:43 +0000 (18:44 +0900)
src/cmd/cmd-activate.c
src/spells-summon.c
src/spells-summon.h

index dc5443a..fb36cf8 100644 (file)
@@ -1729,7 +1729,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
                break;
 
        case ACT_INROU:
-               mitokohmon();
+               mitokohmon(user_ptr);
                break;
 
        case ACT_MURAMASA:
index a806932..7f6d307 100644 (file)
@@ -290,19 +290,19 @@ int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x)
 }
 
 
-void mitokohmon(void)
+void mitokohmon(player_type *kohmon_ptr)
 {
        int count = 0, i;
        monster_type *m_ptr;
        concptr kakusan = "";
 
-       if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_SUKE, PM_FORCE_PET))
+       if (summon_named_creature(0, kohmon_ptr->y, kohmon_ptr->x, MON_SUKE, PM_FORCE_PET))
        {
                msg_print(_("『助さん』が現れた。", "Suke-san apperars."));
                kakusan = "Suke-san";
                count++;
        }
-       if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_KAKU, PM_FORCE_PET))
+       if (summon_named_creature(0, kohmon_ptr->y, kohmon_ptr->x, MON_KAKU, PM_FORCE_PET))
        {
                msg_print(_("『格さん』が現れた。", "Kaku-san appears."));
                kakusan = "Kaku-san";
@@ -310,13 +310,13 @@ void mitokohmon(void)
        }
        if (!count)
        {
-               for (i = p_ptr->current_floor_ptr->m_max - 1; i > 0; i--)
+               for (i = kohmon_ptr->current_floor_ptr->m_max - 1; i > 0; i--)
                {
-                       m_ptr = &p_ptr->current_floor_ptr->m_list[i];
+                       m_ptr = &kohmon_ptr->current_floor_ptr->m_list[i];
                        if (!monster_is_valid(m_ptr)) continue;
                        if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
-                       if (!los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
-                       if (!projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
+                       if (!los(m_ptr->fy, m_ptr->fx, kohmon_ptr->y, kohmon_ptr->x)) continue;
+                       if (!projectable(m_ptr->fy, m_ptr->fx, kohmon_ptr->y, kohmon_ptr->x)) continue;
                        count++;
                        break;
                }
index a1790d6..a2d9b1e 100644 (file)
@@ -67,5 +67,5 @@ extern bool cast_summon_greater_demon(void);
 extern bool summon_kin_player(DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode);
 extern int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x);
 
-extern void mitokohmon(void);
+extern void mitokohmon(player_type *kohmon_ptr);