Add message and bailout on invalid save.

Note: save/resume still fails at saveresume.4
at this revision.
This commit is contained in:
Eric S. Raymond 2023-03-12 06:39:57 -04:00
parent 569a39aa7c
commit 04df0ce64c
3 changed files with 17 additions and 20 deletions

View file

@ -137,7 +137,10 @@ int restore(FILE* fp)
fclose(fp);
if (save.version != VRSION) {
rspeak(VERSION_SKEW, save.version / 10, MOD(save.version, 10), VRSION / 10, MOD(VRSION, 10));
} else if (is_valid(save.game)) {
} else if (!is_valid(save.game)) {
rspeak(SAVE_TAMPERING);
exit(EXIT_SUCCESS);
} else {
game = save.game;
}
return GO_TOP;