loc_t dloc[NDWARVES + 1]; // location of dwarves, initially hard-wired in
loc_t odloc[NDWARVES + 1]; // prior loc of each dwarf, initially garbage
loc_t fixed[NOBJECTS + 1]; // fixed location of object (if not IS_FREE)
- long link[NOBJECTS * 2 + 1]; // object-list links
+ obj_t link[NOBJECTS * 2 + 1]; // object-list links
loc_t place[NOBJECTS + 1]; // location of object
long hinted[NHINTS]; // hinted[i] = true iff hint i has been used.
long hintlc[NHINTS]; // hintlc[i] = how long at LOC with cond bit i
}
/* Check that properties of objects aren't beyond expected */
- for (int obj = 0; obj <= NOBJECTS; obj++) {
+ for (obj_t obj = 0; obj <= NOBJECTS; obj++) {
if (valgame.prop[obj] < STATE_NOTFOUND || valgame.prop[obj] > 1) {
switch (obj) {
case RUG:
}
}
- /* Check that we have objects at locations */
+ /* Check that values in linked lists for objects in locations are inside bounds */
for (loc_t loc = LOC_NOWHERE; loc <= NLOCATIONS; loc++) {
- if (valgame.atloc[loc] < NO_OBJECT || valgame.atloc[loc] > NOBJECTS * 2 + 1) {
+ if (valgame.atloc[loc] < NO_OBJECT || valgame.atloc[loc] > NOBJECTS * 2) {
+ return false;
+ }
+ }
+ for (obj_t obj = 0; obj <= NOBJECTS * 2; obj++ ) {
+ if (valgame.link[obj] < NO_OBJECT || valgame.link[obj] > NOBJECTS * 2) {
return false;
}
}