Relax the savefile validity check a little.

There was a very old bug, probably predating the OpenAdventure port,
that would poke a stashed value of -1 into the snake object if you did
a save in endgame, and then fail the savefile validation on resume.
This was masked for a long time by a bug in put() just fixed a couple
of revisions ago.
This commit is contained in:
Eric S. Raymond 2023-03-12 10:03:43 -04:00
parent 04df0ce64c
commit 0ffb297801
3 changed files with 20 additions and 9 deletions

View file

@ -219,7 +219,8 @@ bool is_valid(struct game_t valgame)
/* Check that properties of objects aren't beyond expected */
for (obj_t obj = 0; obj <= NOBJECTS; obj++) {
if (valgame.prop[obj] < STATE_NOTFOUND || valgame.prop[obj] > 1) {
/* Magic number -2 allows a STASHED version of state 1 */
if (valgame.prop[obj] < -2 || valgame.prop[obj] > 1) {
switch (obj) {
case RUG:
case DRAGON: