OSDN Git Service

is_magic()マクロが領域番号0以下に対してもTRUEを返していたバグを修正.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 3 May 2003 08:22:14 +0000 (08:22 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 3 May 2003 08:22:14 +0000 (08:22 +0000)
src/defines.h

index d20f2d7..06e9726 100644 (file)
 #define VALID_REALM        (MAX_REALM + MAX_MAGIC - MIN_TECHNIC + 1)
 #define NUM_TECHNIC        (MAX_REALM - MIN_TECHNIC + 1)
 
-#define is_magic(A) ((A) < MAX_MAGIC + 1 ? TRUE : FALSE)
+#define is_magic(A) ((((A) > REALM_NONE) && ((A) < MAX_MAGIC + 1)) ? TRUE : FALSE)
 #define tval2realm(A) ((A) - TV_LIFE_BOOK + 1)
 #define technic2magic(A)      (is_magic(A) ? (A) : (A) - MIN_TECHNIC + 1 + MAX_MAGIC)
 #define is_good_realm(REALM)   ((REALM) == REALM_LIFE || (REALM) == REALM_CRUSADE)