[game] Validate a save before giving up the running session - #325
Open
Eldbury wants to merge 1 commit into
Open
Conversation
Loading a save reset the game first and resolved the save afterwards, so any failure along the way left nothing behind: the previous session had already been dismantled, the replacement never arrived, and the engine went on running with nothing to draw. The load screen reported the error onto a black window. Resolve and validate the candidate first, reading it through the unpublished session rather than the director, which still answers for the save that is currently loaded. Records the loader treats as mandatory are proven while the old session is still authoritative, so a save that cannot be loaded now leaves the player where they were instead of stranding them. The decoded records are carried into restoration rather than parsed again once the candidate is published. The old runtime and the old mounts retire together, and only then does the candidate become authoritative, so no runtime ever observes the other session's resources. onGameLoad keeps its slot overload as the atomic wrapper over prepareGameLoad and commitGameLoad. Module activation and the module load itself stay fallible after that point and cannot be proven in advance without performing them. Those failures are terminal, and now end on a deliberate screen: retiring alone left Screen::None, which is the black window this started with. Retail corroborates the ordering - CServerExoAppInternal::LoadGame reads the party table and globals before the running module is replaced - but its recovered form performs no validation and no rollback, and the load is dispatched fire-and-forget, so corrupt-save behaviour is not recoverable from it. This is a transactional correction, not a claim of vanilla parity.
Eldbury
force-pushed
the
fix/validate-save-before-retire
branch
from
August 25, 2026 02:42
ae8f163 to
df1048e
Compare
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.
Summary
Game::loadGamereset the running game before the selected save had been validated. If opening the save failed, the current session was already gone and the game could be left without a playable runtime.The selected save is now validated before the running session is retired. If validation fails, the current session remains intact. If loading fails after that commit point, the game returns to the main menu rather than leaving a partially restored runtime.
Validation
Adds K1/K2 coverage for failed-load preservation, successful replacement and post-commit failure handling.
Full suite passes. Live K1/K2 smoke confirms a rejected save leaves the current session playable and a valid save still loads normally.