OSDN Git Service

[Refactor] #38997 lore_do_probe() にplayer_type * 引数追加 / Added player_type * argument...
authorHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 04:32:03 +0000 (13:32 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 14:01:52 +0000 (23:01 +0900)
src/bldg.c
src/monster.h
src/monster2.c
src/spells2.c

index 5c1b6e1..be71270 100644 (file)
@@ -3810,7 +3810,7 @@ static bool research_mon(player_type *player_ptr)
                                /*** Recall on screen ***/
 
                                /* Get maximal info about this monster */
-                               lore_do_probe(r_idx);
+                               lore_do_probe(player_ptr, r_idx);
 
                                /* Save this monster ID */
                                monster_race_track(player_ptr, r_idx);
index 02f3507..12fd26c 100644 (file)
@@ -474,7 +474,7 @@ extern void wipe_monsters_list(player_type *player_ptr);
 extern MONSTER_IDX m_pop(player_type *player_ptr);
 extern errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type monster_hook, monsterrace_hook_type monster_hook2);
 extern MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH level);
-extern int lore_do_probe(MONRACE_IDX r_idx);
+extern int lore_do_probe(player_type *player_ptr, MONRACE_IDX r_idx);
 extern void lore_treasure(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);
index ac823f8..d440656 100644 (file)
@@ -1622,19 +1622,20 @@ void monster_desc(player_type *player_ptr, char *desc, monster_type *m_ptr, BIT_
 */
 void monster_name(player_type *player_ptr, MONSTER_IDX m_idx, char* m_name)
 {
-       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+       monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
        monster_desc(player_ptr, m_name, m_ptr, 0x00);
 }
 
 
 /*!
  * @brief モンスターの調査による思い出補完処理 / Learn about a monster (by "probing" it)
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param r_idx 補完されるモンスター種族ID
  * @return 明らかになった情報の度数
  * @details
  * Return the number of new flags learnt.  -Mogami-
  */
-int lore_do_probe(MONRACE_IDX r_idx)
+int lore_do_probe(player_type *player_ptr, MONRACE_IDX r_idx)
 {
        monster_race *r_ptr = &r_info[r_idx];
        int i, n = 0;
@@ -1720,9 +1721,9 @@ int lore_do_probe(MONRACE_IDX r_idx)
        r_ptr->r_xtra1 |= MR1_SINKA;
 
        /* Update monster recall window */
-       if (p_ptr->monster_race_idx == r_idx)
+       if (player_ptr->monster_race_idx == r_idx)
        {
-               p_ptr->window |= (PW_MONSTER);
+               player_ptr->window |= (PW_MONSTER);
        }
 
        /* Return the number of new flags learnt */
index 88d5b56..c2b8f12 100644 (file)
@@ -1362,7 +1362,7 @@ bool probing(player_type *caster_ptr)
 
                Term_erase(0, 0, 255);
 
-               if (lore_do_probe(m_ptr->r_idx))
+               if (lore_do_probe(caster_ptr, m_ptr->r_idx))
                {
                        strcpy(buf, (r_name + r_ptr->name));
 #ifdef JP