From: Hourier Date: Sun, 16 Feb 2020 14:28:46 +0000 (+0900) Subject: [Refactor] #40030 process_monster() からupdate_player_type() を分離 / Separated update_pla... X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c9754e65c850cae9b2eddd6e750c91f2efc78262;hp=5624b9a9e70c530011b350ed7629777732710cbc;p=hengband%2Fhengband.git [Refactor] #40030 process_monster() からupdate_player_type() を分離 / Separated update_player_type() from process_monster() --- diff --git a/src/monster-process.c b/src/monster-process.c index 178205bf1..5ebebb773 100644 --- a/src/monster-process.c +++ b/src/monster-process.c @@ -90,6 +90,8 @@ bool update_riding_monster(player_type *target_ptr, turn_flags *turn_flags_ptr, void update_object_by_monster_movement(player_type *target_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION ny, POSITION nx); +void update_player_type(player_type *target_ptr, turn_flags *turn_flags_ptr, monster_race *r_ptr); + /*! * @brief モンスターが敵に接近するための方向を決める / * Calculate the direction to the next enemy @@ -1173,17 +1175,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx) } } - if (turn_flags_ptr->do_view) - { - target_ptr->update |= (PU_FLOW); - target_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); - } - - if (turn_flags_ptr->do_move && ((r_ptr->flags7 & (RF7_SELF_LD_MASK | RF7_HAS_DARK_1 | RF7_HAS_DARK_2)) - || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !target_ptr->phase_out))) - { - target_ptr->update |= (PU_MON_LITE); - } + update_player_type(target_ptr, turn_flags_ptr, r_ptr); if (is_original_ap_and_seen(target_ptr, m_ptr)) { @@ -2468,6 +2460,28 @@ void update_object_by_monster_movement(player_type *target_ptr, turn_flags *turn /*! + * @brief updateフィールドを更新する + * @param target_ptr プレーヤーへの参照ポインタ + * @param turn_flags_ptr ターン経過処理フラグへの参照ポインタ + * @return なし + */ +void update_player_type(player_type *target_ptr, turn_flags *turn_flags_ptr, monster_race *r_ptr) +{ + if (turn_flags_ptr->do_view) + { + target_ptr->update |= (PU_FLOW); + target_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); + } + + if (turn_flags_ptr->do_move && ((r_ptr->flags7 & (RF7_SELF_LD_MASK | RF7_HAS_DARK_1 | RF7_HAS_DARK_2)) + || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !target_ptr->phase_out))) + { + target_ptr->update |= (PU_MON_LITE); + } +} + + +/*! * @brief 全モンスターのターン管理メインルーチン / * Process all the "live" monsters, once per game turn. * @return なし