fix(savegame): Load save games on non-Windows builds - #3236
Draft
bobtista wants to merge 1 commit into
Draft
Conversation
bobtista
force-pushed
the
bobtista/fix/savegame-load-non-windows
branch
from
August 29, 2026 02:39
33aa7b2 to
d0fa953
Compare
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
GameState::portableMapPathToRealMapPathlowercases the real path it returns, andgetSaveDirectoryappends the mixed caseSavecomponent, so the two can never match on a case sensitive platform regardless of how the rest of the user data directory is spelled.GameState::isInSaveDirectorythen compares that lowercased path withFileSystem::isPathInDirectory, which compares case insensitively only on Windows. On every other platformSavenever matchessave,GameStateMap::xferthrows on that check, and no save game can be loaded.Before #1058 the check was
path.startsWithNoCase(getSaveDirectory()). #1058 replaced it with the strict containment helper it added for a different purpose, and the case insensitivity was lost off Windows.Now
isInSaveDirectorylowercases both sides before delegating, so the comparison is case insensitive again while the path is still normalized. Windows behaviour is unchanged, the lowercased map name is unchanged, and every caller ofisInSaveDirectoryis fixed, including the restart path and the map name checks inGameLogic.FileSystem::isPathInDirectoryis deliberately left strict. #1058 added it to validate network supplied portable paths, andConnectionManager::processFileopens the path it produces withCREATE | WRITE, so its result authorizes a file write and it should keep comparing case sensitively off Windows.Todo:
FileSystem::isPathInDirectoryis unchanged and still case sensitive off Windowsz_generalsandg_generals)FileSystem::isPathInDirectory