OSDN Git Service

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

index dc00e9c..c5457f5 100644 (file)
@@ -169,12 +169,11 @@ BIT_FLAGS have_esp_demon(player_type *creature_ptr)
        return result;
 }
 
-void have_esp_orc(player_type *creature_ptr)
+BIT_FLAGS have_esp_orc(player_type *creature_ptr)
 {
     object_type *o_ptr;
     BIT_FLAGS flgs[TR_FLAG_SIZE];
-
-    creature_ptr->esp_orc = FALSE;
+    BIT_FLAGS result = 0L;
 
     for (inventory_slot_type i = INVEN_RARM; i < INVEN_TOTAL; i++) {
         o_ptr = &creature_ptr->inventory_list[i];
@@ -184,8 +183,10 @@ void have_esp_orc(player_type *creature_ptr)
         object_flags(creature_ptr, o_ptr, flgs);
 
         if (have_flag(flgs, TR_ESP_ORC))
-            creature_ptr->esp_orc = TRUE;
+            result |= 0x01 << (i - INVEN_RARM);
     }
+
+       return result;
 }
 
 void have_esp_troll(player_type *creature_ptr)
index 92a1194..81a4a92 100644 (file)
@@ -26,7 +26,7 @@ BIT_FLAGS have_esp_evil(player_type *creature_ptr);
 BIT_FLAGS have_esp_animal(player_type *creature_ptr);
 BIT_FLAGS have_esp_undead(player_type *creature_ptr);
 BIT_FLAGS have_esp_demon(player_type *creature_ptr);
-void have_esp_orc(player_type *creature_ptr);
+BIT_FLAGS have_esp_orc(player_type *creature_ptr);
 void have_esp_troll(player_type *creature_ptr);
 void have_esp_giant(player_type *creature_ptr);
 void have_esp_dragon(player_type *creature_ptr);
index 04960cd..9d12c4d 100644 (file)
@@ -303,7 +303,7 @@ void calc_bonuses(player_type *creature_ptr)
     BIT_FLAGS old_esp_animal = creature_ptr->esp_animal;
     BIT_FLAGS old_esp_undead = creature_ptr->esp_undead;
     BIT_FLAGS old_esp_demon = creature_ptr->esp_demon;
-    bool old_esp_orc = creature_ptr->esp_orc;
+    BIT_FLAGS old_esp_orc = creature_ptr->esp_orc;
     bool old_esp_troll = creature_ptr->esp_troll;
     bool old_esp_giant = creature_ptr->esp_giant;
     bool old_esp_dragon = creature_ptr->esp_dragon;
@@ -326,7 +326,7 @@ void calc_bonuses(player_type *creature_ptr)
     creature_ptr->esp_animal = have_esp_animal(creature_ptr);
     creature_ptr->esp_undead = have_esp_undead(creature_ptr);
     creature_ptr->esp_demon = have_esp_demon(creature_ptr);
-    have_esp_orc(creature_ptr);
+    creature_ptr->esp_orc = have_esp_orc(creature_ptr);
     have_esp_troll(creature_ptr);
     have_esp_giant(creature_ptr);
     have_esp_dragon(creature_ptr);
index 71e337e..6f4e46e 100644 (file)
@@ -420,7 +420,7 @@ typedef struct player_type {
     BIT_FLAGS esp_animal;
     BIT_FLAGS esp_undead;
     BIT_FLAGS esp_demon;
-    bool esp_orc;
+    BIT_FLAGS esp_orc;
     bool esp_troll;
     bool esp_giant;
     bool esp_dragon;