Accept saves taken while a unit is entering a building - #143
Closed
Giszmo wants to merge 1 commit into
Closed
Conversation
A unit on its final step into a building (displacement DIS_ENTERING_BUILDING) already carries the building's position, but by design it stays registered on the map cell it came from until it is inside; UnitDisplacement.cpp clears (posX-dx, posY-dy) at that point. Game::load's air-unit invariant demanded that every registered cell equal the unit's position, so a save written during those few ticks was rejected as corrupt for good. Any game with an explorer heading into an inn could hit it, and Leo's FourSquares1 save did (explorer at 78,66, dx=1, registered at 77,66). Compare against the cell the unit is expected to occupy in that state instead. Verified: the rejected save loads and runs headless; a fresh save still loads.
genixpro
previously approved these changes
Sep 6, 2026
genixpro
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the focused diff and validated it against current master. The combined set applies cleanly after the five already merged fixes and builds successfully on macOS arm64; this PR has green Ubuntu 22.04, Ubuntu 24.04, and Windows CI.
genixpro
dismissed
their stale review
September 6, 2026 01:14
Superseding provisional compile-only approval while behavior-focused testing is completed.
Contributor
|
Current already contains the entering-building integrity handling in . The old branch conflicts because the implementation was split during the refactor. This PR is superseded on current master. |
Contributor
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.
Cherry-picked bugfix from PR #132 (fix/fullscreen-scaling), split out to shrink #132/#129's diff against master per Leo's request.
A unit on its final step into a building (displacement DIS_ENTERING_BUILDING) already carries the building's position, but the integrity check rejected the save as invalid, so games with a unit in that exact state failed to load.
Original commit: 9f48906