OSDN Git Service

[Refactor] #40514 have_pass_wall() を返り値持ちに仕様変更. / have_pass_wall() was changed specif...
authordeskull <deskull@users.sourceforge.jp>
Mon, 17 Aug 2020 15:19:50 +0000 (00:19 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 17 Aug 2020 15:19:50 +0000 (00:19 +0900)
src/player/player-status-flags.c
src/player/player-status-flags.h
src/player/player-status.c

index 942263b..ed2f1b8 100644 (file)
@@ -50,28 +50,22 @@ void have_kill_wall(player_type *creature_ptr)
     }
 }
 
-void have_pass_wall(player_type *creature_ptr)
+bool have_pass_wall(player_type *creature_ptr)
 {
-    creature_ptr->pass_wall = FALSE;
+    bool pow = FALSE;
 
-    if (creature_ptr->wraith_form) {
-        creature_ptr->pass_wall = TRUE;
-    }
-
-    if (creature_ptr->tim_pass_wall) {
-        creature_ptr->pass_wall = TRUE;
-    }
-
-    if (!creature_ptr->mimic_form && creature_ptr->prace == RACE_SPECTRE) {
-        creature_ptr->pass_wall = TRUE;
+    if (creature_ptr->wraith_form || creature_ptr->tim_pass_wall || (!creature_ptr->mimic_form && creature_ptr->prace == RACE_SPECTRE)) {
+        pow = TRUE;
     }
 
     if (creature_ptr->riding) {
         monster_type *riding_m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
         monster_race *riding_r_ptr = &r_info[riding_m_ptr->r_idx];
         if (!(riding_r_ptr->flags2 & RF2_PASS_WALL))
-            creature_ptr->pass_wall = FALSE;
+            pow = FALSE;
     }
+
+       return pow;
 }
 
 void have_xtra_might(player_type *creature_ptr)
index 5dbea52..cd54392 100644 (file)
@@ -1,6 +1,6 @@
 #include "player/player-status.h"
 
-void have_pass_wall(player_type *creature_ptr);
+bool have_pass_wall(player_type *creature_ptr);
 void have_kill_wall(player_type *creature_ptr);
 void have_xtra_might(player_type *creature_ptr);
 void have_esp_evil(player_type *creature_ptr);
index 800082a..4a56298 100644 (file)
@@ -327,7 +327,7 @@ void calc_bonuses(player_type *creature_ptr)
     have_two_handed_weapons(creature_ptr);
     calc_weapon_weight_limit(creature_ptr);
 
-    have_pass_wall(creature_ptr);
+    creature_ptr->pass_wall = have_pass_wall(creature_ptr);
     have_kill_wall(creature_ptr);
     have_xtra_might(creature_ptr);
     have_esp_evil(creature_ptr);