OSDN Git Service

[Refactor] #40514 #40652 have_down_saving() を BIT_FLAGS 返り値持ちに仕様変更. / have_down_savin...
authordeskull <deskull@users.sourceforge.jp>
Mon, 24 Aug 2020 16:38:30 +0000 (01:38 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 24 Aug 2020 16:38:30 +0000 (01:38 +0900)
src/player/player-status-flags.c
src/player/player-status-flags.h
src/player/player-status.c
src/player/player-status.h

index e5c9da9..5a63b79 100644 (file)
@@ -222,23 +222,11 @@ BIT_FLAGS have_easy2_weapon(player_type *creature_ptr)
     return result;
 }
 
-void have_down_saving(player_type *creature_ptr)
+BIT_FLAGS have_down_saving(player_type *creature_ptr)
 {
-    object_type *o_ptr;
-    BIT_FLAGS flgs[TR_FLAG_SIZE];
-
-    creature_ptr->down_saving = FALSE;
-
-    for (inventory_slot_type i = INVEN_RARM; i < INVEN_TOTAL; i++) {
-        o_ptr = &creature_ptr->inventory_list[i];
-        if (!o_ptr->k_idx)
-            continue;
-
-        object_flags(creature_ptr, o_ptr, flgs);
-
-        if (o_ptr->name2 == EGO_AMU_NAIVETY)
-            creature_ptr->down_saving = TRUE;
-    }
+    BIT_FLAGS result = 0L;
+    result |= check_equipment_flags(creature_ptr, TR_DOWN_SAVING);
+    return result;
 }
 
 void have_no_ac(player_type *creature_ptr)
index 0dead9b..70107b9 100644 (file)
@@ -39,7 +39,7 @@ BIT_FLAGS have_esp_unique(player_type *creature_ptr);
 BIT_FLAGS have_esp_telepathy(player_type *creature_ptr);
 BIT_FLAGS have_bless_blade(player_type *creature_ptr);
 BIT_FLAGS have_easy2_weapon(player_type *creature_ptr);
-void have_down_saving(player_type *creature_ptr);
+BIT_FLAGS have_down_saving(player_type *creature_ptr);
 void have_no_ac(player_type *creature_ptr);
 void have_no_flowed(player_type *creature_ptr);
 BIT_FLAGS have_mighty_throw(player_type *creature_ptr);
index 1c48c63..43bb18c 100644 (file)
@@ -337,7 +337,7 @@ void calc_bonuses(player_type *creature_ptr)
     creature_ptr->telepathy = have_esp_telepathy(creature_ptr);
     creature_ptr->bless_blade = have_bless_blade(creature_ptr);
     creature_ptr->easy_2weapon = have_easy2_weapon(creature_ptr);
-    have_down_saving(creature_ptr);
+    creature_ptr->down_saving = have_down_saving(creature_ptr);
     have_no_ac(creature_ptr);
     creature_ptr->mighty_throw = have_mighty_throw(creature_ptr);
     creature_ptr->dec_mana = have_dec_mana(creature_ptr);
index eb9694e..938dddc 100644 (file)
@@ -331,7 +331,7 @@ typedef struct player_type {
     bool monlite;
     bool yoiyami;
     BIT_FLAGS easy_2weapon;
-    bool down_saving;
+    BIT_FLAGS down_saving;
 
     POSITION cur_lite; /* Radius of lite (if any) */