Skip to content

Commit e3f7584

Browse files
committed
Fixed incorrect seed value for restarted skirmish games (multiplayer maps).
1 parent fa9345a commit e3f7584

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

  • GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ static void restartMissionMenu()
200200
Int gameMode = TheGameLogic->getGameMode();
201201
AsciiString mapName = TheGlobalData->m_mapName;
202202

203+
// TheSuperHackers @bugfix Caball009 07/02/2026 Reuse the previous seed value for the new skirmish match to prevent mismatches.
204+
// Campaign, challenge, and skirmish single-player scenarios all use GAME_SINGLE_PLAYER and are expected to use 0 as seed value.
205+
const UnsignedInt seed = (gameMode == GAME_SKIRMISH) ? TheSkirmishGameInfo->getSeed() : 0;
206+
203207
//
204208
// if the map name was from a save game it will have "Save/" at the front of it,
205209
// we want to go back to the original pristine map string for the map name when restarting
@@ -238,11 +242,8 @@ static void restartMissionMenu()
238242
TheScriptEngine->getGlobalDifficulty(),
239243
rankPointsStartedWith)
240244
);
241-
//if (TheGlobalData->m_fixedSeed >= 0)
242-
//InitRandom(TheGlobalData->m_fixedSeed);
243-
InitRandom(0);
244-
//else
245-
// InitGameLogicRandom(GameClientRandomValue(0, INT_MAX - 1));
245+
246+
InitRandom(seed);
246247
}
247248
//TheTransitionHandler->remove("QuitFull"); //KRISMORNESS ADD
248249
//quitMenuLayout = nullptr; //KRISMORNESS ADD

0 commit comments

Comments
 (0)