OSDN Git Service

[Refactor] #40030 関数分割を見据え、get_enemy_dir() を静的関数から普通の関数に変更 / To prepare to divide...
authorHourier <hourier@users.sourceforge.jp>
Tue, 18 Feb 2020 10:21:08 +0000 (19:21 +0900)
committerHourier <hourier@users.sourceforge.jp>
Tue, 18 Feb 2020 10:21:18 +0000 (19:21 +0900)
src/monster-process.c
src/spells3.c

index 96d5197..3430e83 100644 (file)
@@ -79,6 +79,8 @@ typedef struct {
 turn_flags *init_turn_flags(player_type *target_ptr, MONSTER_IDX m_idx, turn_flags *turn_flags_ptr);
 old_race_flags *init_old_race_flags(old_race_flags *old_race_flags_ptr);
 
+bool get_enemy_dir(player_type *target_ptr, MONSTER_IDX m_idx, int *mm);
+
 void decide_drop_from_monster(player_type *target_ptr, MONSTER_IDX m_idx, bool is_riding_mon);
 bool process_stealth(player_type *target_ptr, MONSTER_IDX m_idx);
 bool vanish_summoned_children(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m);
@@ -135,7 +137,7 @@ void update_player_window(player_type *target_ptr, old_race_flags *old_race_flag
   * @param mm 移動するべき方角IDを返す参照ポインタ
   * @return 方向が確定した場合TRUE、接近する敵がそもそもいない場合FALSEを返す
   */
-static bool get_enemy_dir(player_type *target_ptr, MONSTER_IDX m_idx, int *mm)
+bool get_enemy_dir(player_type *target_ptr, MONSTER_IDX m_idx, int *mm)
 {
        floor_type *floor_ptr = target_ptr->current_floor_ptr;
        monster_type *m_ptr = &floor_ptr->m_list[m_idx];
index 3e27b46..3599270 100644 (file)
@@ -461,7 +461,7 @@ void teleport_away_followable(player_type *tracer_ptr, MONSTER_IDX m_idx)
 
        bool is_followable = old_ml;
        is_followable &= old_cdis <= MAX_SIGHT;
-       is_followable &= !(current_world_ptr->timewalk_m_idx > 0);
+       is_followable &= current_world_ptr->timewalk_m_idx == 0;
        is_followable &= !tracer_ptr->phase_out;
        is_followable &= los(tracer_ptr, tracer_ptr->y, tracer_ptr->x, oldfy, oldfx);
        if (!is_followable) return;