OSDN Git Service

[Refactor] #38997 set_hostile() にplayer_type * 引数追加 / Added player_type * argument...
authorHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 07:55:23 +0000 (16:55 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 14:01:53 +0000 (23:01 +0900)
src/cmd/cmd-basic.c
src/monster-process.c
src/monster.h
src/monster1.c
src/spells2.c

index 64480c3..d5b1bdf 100644 (file)
@@ -2695,7 +2695,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                                        GAME_TEXT m_name[MAX_NLEN];
                                        monster_desc(creature_ptr, m_name, m_ptr, 0);
                                        msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
-                                       set_hostile(&creature_ptr->current_floor_ptr->m_list[creature_ptr->current_floor_ptr->grid_array[y][x].m_idx]);
+                                       set_hostile(creature_ptr, &creature_ptr->current_floor_ptr->m_list[creature_ptr->current_floor_ptr->grid_array[y][x].m_idx]);
                                }
                        }
                        do_drop = FALSE;
index 2d22604..866a162 100644 (file)
@@ -1461,7 +1461,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                        msg_format(_("%^sは突然敵にまわった!", "%^s suddenly becomes hostile!"), m_name);
                }
 
-               set_hostile(m_ptr);
+               set_hostile(target_ptr, m_ptr);
        }
 
        /* Get the origin */
index 05a124e..6b1ba0f 100644 (file)
@@ -445,7 +445,7 @@ extern monsterrace_hook_type get_monster_hook(player_type *player_ptr);
 extern monsterrace_hook_type get_monster_hook2(player_type *player_ptr, POSITION y, POSITION x);
 extern void set_friendly(monster_type *m_ptr);
 extern void set_pet(player_type *player_ptr, monster_type *m_ptr);
-extern void set_hostile(monster_type *m_ptr);
+extern void set_hostile(player_type *player_ptr, monster_type *m_ptr);
 extern void anger_monster(player_type *player_ptr, monster_type *m_ptr);
 
 /*
index 71a5bfd..26e7f67 100644 (file)
@@ -2083,9 +2083,9 @@ void set_pet(player_type *player_ptr, monster_type *m_ptr)
  * @param m_ptr モンスター情報構造体の参照ポインタ
  * @return なし
  */
-void set_hostile(monster_type *m_ptr)
+void set_hostile(player_type *player_ptr, monster_type *m_ptr)
 {
-       if (p_ptr->phase_out) return;
+       if (player_ptr->phase_out) return;
        m_ptr->smart &= ~SM_PET;
        m_ptr->smart &= ~SM_FRIENDLY;
 }
@@ -2106,7 +2106,7 @@ void anger_monster(player_type *player_ptr, monster_type *m_ptr)
 
        monster_desc(player_ptr, m_name, m_ptr, 0);
        msg_format(_("%^sは怒った!", "%^s gets angry!"), m_name);
-       set_hostile(m_ptr);
+       set_hostile(player_ptr, m_ptr);
        chg_virtue(player_ptr, V_INDIVIDUALISM, 1);
        chg_virtue(player_ptr, V_HONOUR, -1);
        chg_virtue(player_ptr, V_JUSTICE, -1);
index 3fd1e6b..30b39ff 100644 (file)
@@ -1115,7 +1115,7 @@ bool genocide_aux(player_type *caster_ptr, MONSTER_IDX m_idx, int power, bool pl
                                msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
                        }
 
-                       set_hostile(m_ptr);
+                       set_hostile(caster_ptr, m_ptr);
                }
 
                if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;