OSDN Git Service

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

index ed2f1b8..563cdaa 100644 (file)
 #include "util/quarks.h"
 #include "util/string-processor.h"
 
-void have_kill_wall(player_type *creature_ptr)
+bool have_kill_wall(player_type *creature_ptr)
 {
-    creature_ptr->kill_wall = FALSE;
-
-    if (creature_ptr->mimic_form == MIMIC_DEMON_LORD) {
-        creature_ptr->kill_wall = TRUE;
-    }
-
-    if (music_singing(creature_ptr, MUSIC_WALL)) {
-        creature_ptr->kill_wall = TRUE;
+    if (creature_ptr->mimic_form == MIMIC_DEMON_LORD || music_singing(creature_ptr, MUSIC_WALL)) {
+        return 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_KILL_WALL)
-            creature_ptr->kill_wall = TRUE;
+            return TRUE;
     }
+
+       return FALSE;
 }
 
 bool have_pass_wall(player_type *creature_ptr)
index cd54392..3c321ab 100644 (file)
@@ -1,7 +1,7 @@
 #include "player/player-status.h"
 
 bool have_pass_wall(player_type *creature_ptr);
-void have_kill_wall(player_type *creature_ptr);
+bool have_kill_wall(player_type *creature_ptr);
 void have_xtra_might(player_type *creature_ptr);
 void have_esp_evil(player_type *creature_ptr);
 void have_esp_animal(player_type *creature_ptr);
index 4a56298..f869a80 100644 (file)
@@ -328,7 +328,7 @@ void calc_bonuses(player_type *creature_ptr)
     calc_weapon_weight_limit(creature_ptr);
 
     creature_ptr->pass_wall = have_pass_wall(creature_ptr);
-    have_kill_wall(creature_ptr);
+    creature_ptr->kill_wall = have_kill_wall(creature_ptr);
     have_xtra_might(creature_ptr);
     have_esp_evil(creature_ptr);
     have_esp_animal(creature_ptr);