Skip to content

Commit 0bc50ad

Browse files
helmutbuhlerxezon
authored andcommitted
[GEN][ZH] Fix broken replay list when it contains a replay with an unknown map (#732)
1 parent f3d7b54 commit 0bc50ad

File tree

2 files changed

+8
-2
lines changed
  • Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus
  • GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus

2 files changed

+8
-2
lines changed

Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ void PopulateReplayFileListbox(GameWindow *listbox)
181181
const MapMetaData *md = TheMapCache->findMap(info.getMap());
182182
if (!md)
183183
{
184-
mapStr.translate(info.getMap());
184+
// TheSuperHackers @bugfix helmutbuhler 08/03/2025 Just use the filename.
185+
// Displaying a long map path string would break the map list gui.
186+
const char* filename = info.getMap().reverseFind('\\');
187+
mapStr.translate(filename ? filename + 1 : info.getMap());
185188
}
186189
else
187190
{

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ void PopulateReplayFileListbox(GameWindow *listbox)
181181
const MapMetaData *md = TheMapCache->findMap(info.getMap());
182182
if (!md)
183183
{
184-
mapStr.translate(info.getMap());
184+
// TheSuperHackers @bugfix helmutbuhler 08/03/2025 Just use the filename.
185+
// Displaying a long map path string would break the map list gui.
186+
const char* filename = info.getMap().reverseFind('\\');
187+
mapStr.translate(filename ? filename + 1 : info.getMap());
185188
}
186189
else
187190
{

0 commit comments

Comments
 (0)