Repository navigation
Keep out-of-date saves instead of deleting them - #63
Merged
Merged
Conversation
At start-up an existing save older than the hack binary was unlink()ed and a new game started, so every update of the game silently destroyed the player's saved game. The save is now renamed to save/<uid><name>.outdated (or .outdated.1, .2, ... if that name is taken; an existing file is never replaced) and the player is told where it was kept. If the rename fails the file is left alone, the player is told, and the new game refuses to save over it (dosave0() retries the move first, so the game can still be saved once the problem is fixed). Such saves are still not restored: that needs the pointer-free save format. Bones files are unchanged (they are not player saves).
neuhaus
pushed a commit
to neuhaus/restoHack
that referenced
this pull request
Nov 15, 2026
Keep out-of-date saves instead of deleting them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updating the game silently destroyed in-progress saves. At startup the original
uptodate()check finds the save older than the new binary, prints "Saved level is out of date." and the save isunlink()ed. Every AUR upgrade or rebuild did this.This is the safety net while save format v3 (saves that survive updates) is worked on: from now on no save is ever deleted.
What changes
save/<uid><name>.outdated(then.outdated.1,.2, … up to 999; an existing file is never clobbered, and any doubt about whether a name exists means the file is left alone). The player is told: "Your saved game is from an older version and can't be restored yet." / "It was kept as save/….outdated."/* Original 1984: */comment, and the new code carries MODERN ADDITION blocks.uptodate()always passes there, so this path never runs (v3 covers the browser).getbones(), the only otheruptodate()caller) unchanged: those are not player saves.Verified
cmp), message shown, and the new game later saves normally..outdated.1created, earlier.outdateduntouched.chmod a-w save/): no crash, original byte-identical in place, save refused. After fixing permissions mid-game, the nextSmoves the old save to.outdated.2and saves.🤖 Generated with Claude Code