OSDN Git Service

[Refactor] #38997 update_monsters() にplayer_type * 引数追加 / Added player_type * argumen...
authorHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 04:36:14 +0000 (13:36 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 14:01:52 +0000 (23:01 +0900)
src/monster.h
src/monster2.c
src/player-status.c

index 8112a13..7dea535 100644 (file)
@@ -477,7 +477,7 @@ extern MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH level);
 extern int lore_do_probe(player_type *player_ptr, MONRACE_IDX r_idx);
 extern void lore_treasure(player_type *player_ptr, MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold);
 extern void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full);
-extern void update_monsters(bool full);
+extern void update_monsters(player_type *player_ptr, bool full);
 extern bool multiply_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
 extern bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode);
 extern bool summon_named_creature(player_type *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode);
index 608fb41..1a68433 100644 (file)
@@ -2205,21 +2205,22 @@ void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full)
 
 
 /*!
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @brief 単純に生存している全モンスターの更新処理を行う / This function simply updates all the (non-dead) monsters (see above).
  * @param full 距離更新を行うならtrue
  * @return なし
  */
-void update_monsters(bool full)
+void update_monsters(player_type *player_ptr, bool full)
 {
        MONSTER_IDX i;
 
        /* Update each (live) monster */
-       floor_type *floor_ptr = p_ptr->current_floor_ptr;
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        for (i = 1; i < floor_ptr->m_max; i++)
        {
                monster_type *m_ptr = &floor_ptr->m_list[i];
                if (!monster_is_valid(m_ptr)) continue;
-               update_monster(p_ptr, i, full);
+               update_monster(player_ptr, i, full);
        }
 }
 
index d51f0a4..e103ab4 100644 (file)
@@ -4992,10 +4992,7 @@ void update_creature(player_type *creature_ptr)
        {
                creature_ptr->update &= ~(PU_DISTANCE);
 
-               /* Still need to call update_monsters(FALSE) after update_mon_lite() */
-               /* creature_ptr->update &= ~(PU_MONSTERS); */
-
-               update_monsters(TRUE);
+               update_monsters(creature_ptr, TRUE);
        }
 
        if (creature_ptr->update & (PU_MON_LITE))
@@ -5017,7 +5014,7 @@ void update_creature(player_type *creature_ptr)
        if (creature_ptr->update & (PU_MONSTERS))
        {
                creature_ptr->update &= ~(PU_MONSTERS);
-               update_monsters(FALSE);
+               update_monsters(creature_ptr, FALSE);
        }
 }