From 912b5e6089d57029eb48e54b11503e2e712e8789 Mon Sep 17 00:00:00 2001 From: Hourier Date: Sat, 18 Jan 2020 13:32:03 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20lore=5Fdo=5Fprobe()=20?= =?utf8?q?=E3=81=ABplayer=5Ftype=20*=20=E5=BC=95=E6=95=B0=E8=BF=BD?= =?utf8?q?=E5=8A=A0=20/=20Added=20player=5Ftype=20*=20argument=20to=20lore?= =?utf8?q?=5Fdo=5Fprobe()?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/bldg.c | 2 +- src/monster.h | 2 +- src/monster2.c | 9 +++++---- src/spells2.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/bldg.c b/src/bldg.c index 5c1b6e1bb..be7127065 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -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); diff --git a/src/monster.h b/src/monster.h index 02f35071e..12fd26c59 100644 --- a/src/monster.h +++ b/src/monster.h @@ -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); diff --git a/src/monster2.c b/src/monster2.c index ac823f8e2..d4406567d 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -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 */ diff --git a/src/spells2.c b/src/spells2.c index 88d5b567c..c2b8f120b 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -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 -- 2.11.0