Magic-number elimination.
[open-adventure.git] / advent.h
index 1f2bd8c893d18c1ef40a0009992b67c1746bef6b..3802c83f5799baff57f35caf092b9071888cb030 100644 (file)
--- a/advent.h
+++ b/advent.h
@@ -132,7 +132,7 @@ extern int saveresume(FILE *, bool);
  *  TOTING(OBJ) = true if the OBJ is being carried */
 
 #define MOD(N,M)       ((N) % (M))
-#define TOTING(OBJ)    (game.place[OBJ] == -1)
+#define TOTING(OBJ)    (game.place[OBJ] == CARRIED)
 #define AT(OBJ) (game.place[OBJ] == game.loc || game.fixed[OBJ] == game.loc)
 #define HERE(OBJ)      (AT(OBJ) || TOTING(OBJ))
 #define LIQ2(PBOTL)    ((1-(PBOTL))*WATER+((PBOTL)/2)*(WATER+OIL))
@@ -207,6 +207,10 @@ enum speechpart {unknown, intransitive, transitive};
 #define HOGRE  19      /* Trying to deal with ogre */
 #define HJADE  20      /* Found all treasures except jade */
 
+/* Special object statuses in game.place - can also be a location number (> 0) */
+#define CARRIED                -1      /* Player is toting it */
+#define NOWHERE        0       /* It's destroyed */
+
 /* hack to ignore GCC Unused Result */
 #define IGNORE(r) do{if (r){}}while(0)