Skip to content

bugfix(savegame): Handle both separators in fallback map labels - #3362

Draft
bobtista wants to merge 2 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/save-map-label-separators
Draft

bobtista wants to merge 2 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/save-map-label-separators

Conversation

@bobtista

@bobtista bobtista commented Sep 25, 2026 •

Copy link
Copy Markdown

When a map has no label and a save has no description, forward-slash paths can appear in the save list as the full path instead of just the filename.

Now handles both separators in the fallback label, so Maps/foo/foo.map displays as foo.map. Applied to Generals and Zero Hour.

Todo:

  • Test forward-slash, backslash, mixed and bare filenames with focused checks
  • Check that existing map labels are preserved
  • Replicate to Generals
  • Verify the fallback label in the in-game save list

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8d9ea991-768a-4dab-88fe-3d72c3f9b0af

📥 Commits

Reviewing files that changed from the base of the PR and between a046a22 and ffcf008.

📒 Files selected for processing (2)
  • Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp
  • GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


Walkthrough

When the map label is missing or empty, both game variants now use the part of the map name after its last / or \ as the fallback label.

Changes

Map label fallback

Layer / File(s) Summary
Map name separator handling
Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp, GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp
Both variants find the last / or \ in the map name and use the following text as the fallback label.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to ffcf0

The change is limited to fallback labels for maps without a label or save description. No specific merge-blocking risk is evident; the in-game save-list check remains to be completed.

Architecture Summary

Architecture risk: 🔵 Low · up to ffcf0

The change affects 2 systems.

Changed systems: Generals, GeneralsMD

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — Generals (service) was modified; 1 changed file maps to changed impact.
  • observed — GeneralsMD (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp: When the map label is absent or empty, the fallback now searches for the later of the last / and \ and uses the text after that separator; previously, only \ was recognized, and a path without one was used unchanged.
  • observed — Modified behavior in GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp: When no map label is available, the fallback now strips the map name’s final / or \ component separator; previously, it stripped only \ and otherwise retained the full map name.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: the save-game fallback map label now handles both forward-slash and backslash separators.
Description check ✅ Passed The description directly explains the save-list issue, the fallback-label fix, affected games, and reported validation checks.

Comment @coderabbitai help to get the list of available commands.

@bobtista bobtista self-assigned this Sep 25, 2026
@bobtista bobtista added Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker labels Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant