• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisãoe9b586f6636d8ef7535105068a4909a89fef0476 (tree)
Hora2020-02-17 21:47:08
AutorHourier <hourier@user...>
CommiterHourier

Mensagem de Log

[Refactor] #40030 process_monsters() からsave_old_race_flags() を分離 / Separated save_old_race_flags() from process_monsters()

Mudança Sumário

Diff

--- a/src/monster-process.c
+++ b/src/monster-process.c
@@ -119,6 +119,8 @@ void update_object_flags(BIT_FLAGS *flgs, BIT_FLAGS *flg2, BIT_FLAGS *flg3, BIT_
119119 void monster_pickup_object(player_type *target_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, object_type *o_ptr, bool is_special_object, POSITION ny, POSITION nx, GAME_TEXT *m_name, GAME_TEXT *o_name, OBJECT_IDX this_o_idx);
120120 bool process_monster_fear(player_type *target_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx);
121121
122+void save_old_race_flags(player_type *target_ptr, old_race_flags *old_race_flags_ptr);
123+
122124 /*!
123125 * @brief モンスターが敵に接近するための方向を決める /
124126 * Calculate the direction to the next enemy
@@ -2638,26 +2640,7 @@ void process_monsters(player_type *target_ptr)
26382640 floor_ptr->monster_noise = FALSE;
26392641
26402642 MONRACE_IDX old_monster_race_idx = target_ptr->monster_race_idx;
2641- if (target_ptr->monster_race_idx)
2642- {
2643- monster_race *r_ptr;
2644- r_ptr = &r_info[target_ptr->monster_race_idx];
2645-
2646- old_race_flags_ptr->old_r_flags1 = r_ptr->r_flags1;
2647- old_race_flags_ptr->old_r_flags2 = r_ptr->r_flags2;
2648- old_race_flags_ptr->old_r_flags3 = r_ptr->r_flags3;
2649- old_race_flags_ptr->old_r_flags4 = r_ptr->r_flags4;
2650- old_race_flags_ptr->old_r_flags5 = r_ptr->r_flags5;
2651- old_race_flags_ptr->old_r_flags6 = r_ptr->r_flags6;
2652- old_race_flags_ptr->old_r_flagsr = r_ptr->r_flagsr;
2653-
2654- old_race_flags_ptr->old_r_blows0 = r_ptr->r_blows[0];
2655- old_race_flags_ptr->old_r_blows1 = r_ptr->r_blows[1];
2656- old_race_flags_ptr->old_r_blows2 = r_ptr->r_blows[2];
2657- old_race_flags_ptr->old_r_blows3 = r_ptr->r_blows[3];
2658-
2659- old_race_flags_ptr->old_r_cast_spell = r_ptr->r_cast_spell;
2660- }
2643+ save_old_race_flags(target_ptr, old_race_flags_ptr);
26612644
26622645 for (MONSTER_IDX i = floor_ptr->m_max - 1; i >= 1; i--)
26632646 {
@@ -2756,7 +2739,9 @@ void process_monsters(player_type *target_ptr)
27562739 }
27572740 }
27582741
2759-
2742+/*!
2743+ * @brief old_race_flags_ptr の初期化
2744+ */
27602745 old_race_flags *init_old_race_flags(old_race_flags *old_race_flags_ptr)
27612746 {
27622747 old_race_flags_ptr->old_r_flags1 = 0L;
@@ -2775,3 +2760,32 @@ old_race_flags *init_old_race_flags(old_race_flags *old_race_flags_ptr)
27752760 old_race_flags_ptr->old_r_cast_spell = 0;
27762761 return old_race_flags_ptr;
27772762 }
2763+
2764+
2765+/*!
2766+ * @brief 古いモンスター情報の保存
2767+ * @param target_ptr プレーヤーへの参照ポインタ
2768+ * @param old_race_flags_ptr モンスターフラグへの参照ポインタ
2769+ */
2770+void save_old_race_flags(player_type *target_ptr, old_race_flags *old_race_flags_ptr)
2771+{
2772+ if (target_ptr->monster_race_idx == 0) return;
2773+
2774+ monster_race *r_ptr;
2775+ r_ptr = &r_info[target_ptr->monster_race_idx];
2776+
2777+ old_race_flags_ptr->old_r_flags1 = r_ptr->r_flags1;
2778+ old_race_flags_ptr->old_r_flags2 = r_ptr->r_flags2;
2779+ old_race_flags_ptr->old_r_flags3 = r_ptr->r_flags3;
2780+ old_race_flags_ptr->old_r_flags4 = r_ptr->r_flags4;
2781+ old_race_flags_ptr->old_r_flags5 = r_ptr->r_flags5;
2782+ old_race_flags_ptr->old_r_flags6 = r_ptr->r_flags6;
2783+ old_race_flags_ptr->old_r_flagsr = r_ptr->r_flagsr;
2784+
2785+ old_race_flags_ptr->old_r_blows0 = r_ptr->r_blows[0];
2786+ old_race_flags_ptr->old_r_blows1 = r_ptr->r_blows[1];
2787+ old_race_flags_ptr->old_r_blows2 = r_ptr->r_blows[2];
2788+ old_race_flags_ptr->old_r_blows3 = r_ptr->r_blows[3];
2789+
2790+ old_race_flags_ptr->old_r_cast_spell = r_ptr->r_cast_spell;
2791+}
Show on old repository browser