Skip to content

Commit 9e78404

Browse files
committed
Addressing additional review comments
1 parent fd90bbe commit 9e78404

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,16 +2466,17 @@ void GameLogic::loadMapINI( AsciiString mapName )
24662466
char filename[_MAX_PATH];
24672467
char fullFledgeFilename[_MAX_PATH];
24682468

2469-
strlcpy(filename, mapName.str(), ARRAY_SIZE(filename));
2470-
24712469
//
24722470
// if map name begins with a "SAVE_DIRECTORY\", then the map refers to a map
24732471
// that has been extracted from a save game file ... in that case we need to get
24742472
// the pristine map name string in order to manipulate and load the right map.ini
24752473
// for that map from it's original location
24762474
//
2477-
if (TheGameState->isInSaveDirectory(filename))
2478-
strlcpy(filename, TheGameState->getSaveGameInfo()->pristineMapName.str(), ARRAY_SIZE(filename));
2475+
const char* pristineMapName = TheGameState->isInSaveDirectory(filename)
2476+
? TheGameState->getSaveGameInfo()->pristineMapName.str()
2477+
: mapName.str();
2478+
2479+
strlcpy(filename, pristineMapName, ARRAY_SIZE(filename));
24792480

24802481
// sanity
24812482
int length = strlen(filename);

0 commit comments

Comments
 (0)