OSDN Git Service

[Refactor] #37353 複数の object_is_* マクロをobject-hook.h へ移動。
authordeskull <deskull@users.sourceforge.jp>
Wed, 10 Apr 2019 11:10:28 +0000 (20:10 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 10 Apr 2019 11:10:28 +0000 (20:10 +0900)
src/defines.h
src/files.c
src/object-hook.h
src/player-move.c
src/wizard1.c

index 01316d4..2ad1ac8 100644 (file)
 #define term_screen     (angband_term[0])
 
 
-/*
- * Determine if a given inventory item is "known"
- * Test One -- Check for special "known" tag
- * Test Two -- Check for "Easy Know" + "Aware"
- */
-#define object_is_known(T) \
-    (((T)->ident & (IDENT_KNOWN)) || \
-     (k_info[(T)->k_idx].easy_know && k_info[(T)->k_idx].aware))
-
 
 /*
  * Return the "attr" for a given item.
        ((k_info[(T)->k_idx].flavor) ? \
         (k_info[k_info[(T)->k_idx].flavor].x_attr) : \
         ((!(T)->k_idx || ((T)->tval != TV_CORPSE) || ((T)->sval != SV_CORPSE) || \
-          (k_info[(T)->k_idx].x_attr != TERM_DARK)) ? \
+         (k_info[(T)->k_idx].x_attr != TERM_DARK)) ? \
          (k_info[(T)->k_idx].x_attr) : (r_info[(T)->pval].x_attr)))
 
 /*
 
 
 /*
- * Artifacts use the "name1" field
- */
-#define object_is_fixed_artifact(T) \
-       ((T)->name1 ? TRUE : FALSE)
-
-/*
- * Ego-Items use the "name2" field
- */
-#define object_is_ego(T) \
-       ((T)->name2 ? TRUE : FALSE)
-
-
-/*
- * Broken items.
- */
-#define object_is_broken(T) \
-       ((T)->ident & (IDENT_BROKEN))
-
-/*
- * Cursed items.
- */
-#define object_is_cursed(T) \
-       ((T)->curse_flags)
-
-
-/*
  * Convert an "attr"/"char" pair into a "pict" (P)
  */
 #define PICT(A,C) \
index 49b6dd0..931e6a2 100644 (file)
@@ -27,6 +27,7 @@
 #include "patron.h"
 #include "monster.h"
 #include "monster-status.h"
+#include "object-hook.h"
 
 
 /*
index 8138e2d..845c680 100644 (file)
@@ -61,3 +61,31 @@ extern bool object_is_quest_target(object_type *o_ptr);
   */
 #define object_is_tried(T) (k_info[(T)->k_idx].tried)
 
+ /*
+  * Determine if a given inventory item is "known"
+  * Test One -- Check for special "known" tag
+  * Test Two -- Check for "Easy Know" + "Aware"
+  */
+#define object_is_known(T) (((T)->ident & (IDENT_KNOWN)) || (k_info[(T)->k_idx].easy_know && k_info[(T)->k_idx].aware))
+
+/*
+ * Artifacts use the "name1" field
+ */
+#define object_is_fixed_artifact(T) ((T)->name1 ? TRUE : FALSE)
+
+/*
+ * Ego-Items use the "name2" field
+ */
+#define object_is_ego(T) ((T)->name2 ? TRUE : FALSE)
+
+/*
+ * Broken items.
+ */
+#define object_is_broken(T) ((T)->ident & (IDENT_BROKEN))
+
+/*
+ * Cursed items.
+ */
+#define object_is_cursed(T) ((T)->curse_flags)
+
+
index 70ffd8f..b5c7087 100644 (file)
 #include "warning.h"
 #include "monster.h"
 #include "monster-spell.h"
+#include "object-hook.h"
 
 
 
index 0f4c9cc..50c4e65 100644 (file)
@@ -14,6 +14,7 @@
 #include "sort.h"
 #include "store.h"
 #include "monster.h"
+#include "object-hook.h"
 
 
 #ifdef ALLOW_SPOILERS