From 7c089042eef2cfa1bcfd66f41cfa274f5a9781f4 Mon Sep 17 00:00:00 2001 From: Hourier Date: Sat, 18 Jan 2020 13:33:41 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20lore=5Ftreasure()=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?=5Ftreasure()?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/monster.h | 2 +- src/monster1.c | 2 +- src/monster2.c | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/monster.h b/src/monster.h index 12fd26c59..8112a132d 100644 --- a/src/monster.h +++ b/src/monster.h @@ -475,7 +475,7 @@ 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(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 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 bool multiply_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode); diff --git a/src/monster1.c b/src/monster1.c index 0daa60dc8..d9fc83d10 100644 --- a/src/monster1.c +++ b/src/monster1.c @@ -3097,7 +3097,7 @@ void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item) if (visible && (dump_item || dump_gold)) { /* Take notes on treasure */ - lore_treasure(m_idx, dump_item, dump_gold); + lore_treasure(player_ptr, m_idx, dump_item, dump_gold); } /* Only process "Quest Monsters" */ diff --git a/src/monster2.c b/src/monster2.c index d4406567d..608fb41a0 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -1733,6 +1733,7 @@ int lore_do_probe(player_type *player_ptr, MONRACE_IDX r_idx) /*! * @brief モンスターの撃破に伴うドロップ情報の保管処理 / Take note that the given monster just dropped some treasure + * @param player_ptr プレーヤーへの参照ポインタ * @param m_idx モンスター情報のID * @param num_item 手に入れたアイテム数 * @param num_gold 手に入れた財宝の単位数 @@ -1748,9 +1749,9 @@ int lore_do_probe(player_type *player_ptr, MONRACE_IDX r_idx) * gold and items are dropped, and remembers that information to be * described later by the monster recall code. */ -void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold) +void lore_treasure(player_type *player_ptr, MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold) { - 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_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -1766,9 +1767,9 @@ void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold if (r_ptr->flags1 & (RF1_DROP_GREAT)) r_ptr->r_flags1 |= (RF1_DROP_GREAT); /* Update monster recall window */ - if (p_ptr->monster_race_idx == m_ptr->r_idx) + if (player_ptr->monster_race_idx == m_ptr->r_idx) { - p_ptr->window |= (PW_MONSTER); + player_ptr->window |= (PW_MONSTER); } } -- 2.11.0