Corrected limit for atloc, see init.c for filling double-linked list
authorNHOrus <jy6x2b32pie9@yahoo.com>
Thu, 24 Aug 2017 10:40:10 +0000 (13:40 +0300)
committerNHOrus <jy6x2b32pie9@yahoo.com>
Thu, 24 Aug 2017 10:40:10 +0000 (13:40 +0300)
saveresume.c

index e4d9959aeaa59e460f99bbc11fc30fcbedfd2426..6027096abf1e6035ed4e2bad18dfcb4aed29e953 100644 (file)
@@ -212,7 +212,7 @@ bool is_valid(struct game_t valgame)
 
     /* Check that we have objects at locations */
     for (loc_t loc = LOC_NOWHERE; loc <= NLOCATIONS; loc++) {
-        if (valgame.atloc[loc] < NO_OBJECT || valgame.atloc[loc] > NLOCATIONS) {
+        if (valgame.atloc[loc] < NO_OBJECT || valgame.atloc[loc] > NOBJECTS * 2 + 1) {
             return false;
         }
     }