Condition in alternative state-management macros.
[open-adventure.git] / saveresume.c
index 4cac0343a2a41f7c7a59a573ba61caa44414cf30..9c788d1c59f99a523a535e139c3842cc12b50aa3 100644 (file)
@@ -218,7 +218,7 @@ bool is_valid(struct game_t valgame)
     int temp_tally = 0;
     for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
         if (objects[treasure].is_treasure) {
-            if (valgame.objects[treasure].prop == STATE_NOTFOUND) {
+            if (PROP_IS_NOTFOUND2(valgame, treasure)) {
                 ++temp_tally;
             }
         }
@@ -229,8 +229,7 @@ bool is_valid(struct game_t valgame)
 
     /* Check that properties of objects aren't beyond expected */
     for (obj_t obj = 0; obj <= NOBJECTS; obj++) {
-       /* Magic number -2 allows a STASHED version of state 1 */
-        if (valgame.objects[obj].prop < -2 || valgame.objects[obj].prop > 1) {
+        if (PROP_IS_INVALID(valgame.objects[obj].prop)) {
             switch (obj) {
             case RUG:
             case DRAGON: