From: Hourier Date: Sat, 18 Jan 2020 04:52:24 +0000 (+0900) Subject: [Refactor] #38997 monster_drop_carried_objects() にplayer_type * 引数追加 / Added player_t... X-Git-Tag: vmacos3.0.0-alpha52~1903^2~42 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=80ce66e3378a6555c305d97bc052270e67ea8301;p=hengbandforosx%2Fhengbandosx.git [Refactor] #38997 monster_drop_carried_objects() にplayer_type * 引数追加 / Added player_type * argument to monster_drop_carried_objects() --- diff --git a/src/cmd/cmd-pet.c b/src/cmd/cmd-pet.c index e55f23ff9..d610b7c49 100644 --- a/src/cmd/cmd-pet.c +++ b/src/cmd/cmd-pet.c @@ -900,7 +900,7 @@ void do_cmd_pet(player_type *creature_ptr) if (is_pet(m_ptr)) { - monster_drop_carried_objects(m_ptr); + monster_drop_carried_objects(creature_ptr, m_ptr); } } } diff --git a/src/monster.h b/src/monster.h index 5a3f33d22..3bc1dd4f1 100644 --- a/src/monster.h +++ b/src/monster.h @@ -508,7 +508,7 @@ extern void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int w extern void choose_new_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx); extern SPEED get_mspeed(player_type *player_ptr, monster_race *r_ptr); -extern void monster_drop_carried_objects(monster_type *m_ptr); +extern void monster_drop_carried_objects(player_type *player_ptr, monster_type *m_ptr); #define is_friendly(A) \ (bool)(((A)->smart & SM_FRIENDLY) ? TRUE : FALSE) diff --git a/src/monster1.c b/src/monster1.c index d9fc83d10..c4014dc26 100644 --- a/src/monster1.c +++ b/src/monster1.c @@ -2686,7 +2686,7 @@ void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item) } /* Drop objects being carried */ - monster_drop_carried_objects(m_ptr); + monster_drop_carried_objects(player_ptr, m_ptr); if (r_ptr->flags1 & RF1_DROP_GOOD) mo_mode |= AM_GOOD; if (r_ptr->flags1 & RF1_DROP_GREAT) mo_mode |= AM_GREAT; diff --git a/src/monster2.c b/src/monster2.c index 95d377ac5..7878548bd 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -4061,10 +4061,11 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what) /*! * @brief モンスターが盗みや拾いで確保していたアイテムを全てドロップさせる / Drop all items carried by a monster + * @param player_ptr プレーヤーへの参照ポインタ * @param m_ptr モンスター参照ポインタ * @return なし */ -void monster_drop_carried_objects(monster_type *m_ptr) +void monster_drop_carried_objects(player_type *player_ptr, monster_type *m_ptr) { OBJECT_IDX this_o_idx, next_o_idx = 0; object_type forge; @@ -4072,7 +4073,7 @@ void monster_drop_carried_objects(monster_type *m_ptr) object_type *q_ptr; /* Drop objects being carried */ - floor_type *floor_ptr = p_ptr->current_floor_ptr; + floor_type *floor_ptr = player_ptr->current_floor_ptr; for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx) { o_ptr = &floor_ptr->o_list[this_o_idx]; @@ -4087,7 +4088,7 @@ void monster_drop_carried_objects(monster_type *m_ptr) delete_object_idx(floor_ptr, this_o_idx); /* Drop it */ - (void)drop_near(p_ptr, q_ptr, -1, m_ptr->fy, m_ptr->fx); + (void)drop_near(player_ptr, q_ptr, -1, m_ptr->fy, m_ptr->fx); } /* Forget objects */