Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ static void restartMissionMenu()
Int gameMode = TheGameLogic->getGameMode();
AsciiString mapName = TheGlobalData->m_mapName;

// TheSuperHackers @bugfix Caball009 07/02/2026 Reuse the previous seed value for the new skirmish match to prevent mismatches.
Comment thread
Caball009 marked this conversation as resolved.
// Campaign, challenge, and skirmish single-player scenarios all use GAME_SINGLE_PLAYER and are expected to use 0 as seed value.
DEBUG_ASSERTCRASH((TheSkirmishGameInfo != nullptr) == (gameMode == GAME_SKIRMISH), ("Unexpected game mode on map / mission restart"));
const UnsignedInt seed = TheSkirmishGameInfo ? TheSkirmishGameInfo->getSeed() : 0;
Comment thread
Caball009 marked this conversation as resolved.
Outdated

//
// if the map name was from a save game it will have "Save/" at the front of it,
// we want to go back to the original pristine map string for the map name when restarting
Expand Down Expand Up @@ -238,11 +243,8 @@ static void restartMissionMenu()
TheScriptEngine->getGlobalDifficulty(),
rankPointsStartedWith)
);
//if (TheGlobalData->m_fixedSeed >= 0)
//InitRandom(TheGlobalData->m_fixedSeed);
InitRandom(0);
//else
// InitGameLogicRandom(GameClientRandomValue(0, INT_MAX - 1));

InitRandom(seed);
}
//TheTransitionHandler->remove("QuitFull"); //KRISMORNESS ADD
//quitMenuLayout = nullptr; //KRISMORNESS ADD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ void reallyDoStart( void )

TheWritableGlobalData->m_mapName = TheSkirmishGameInfo->getMap();
TheSkirmishGameInfo->startGame(0);
InitGameLogicRandom(TheSkirmishGameInfo->getSeed());

Bool isSkirmish = TRUE;
const MapMetaData *md = TheMapCache->findMap(TheSkirmishGameInfo->getMap());
Expand All @@ -431,6 +430,8 @@ void reallyDoStart( void )

if (isSkirmish)
{
InitGameLogicRandom(TheSkirmishGameInfo->getSeed());

GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
msg->appendIntegerArgument(GAME_SKIRMISH);
msg->appendIntegerArgument(DIFFICULTY_NORMAL); // not really used; just specified so we can add the game speed last
Expand All @@ -439,6 +440,8 @@ void reallyDoStart( void )
}
else
{
InitGameLogicRandom(0);

GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
msg->appendIntegerArgument(GAME_SINGLE_PLAYER);
msg->appendIntegerArgument(DIFFICULTY_NORMAL); // not really used; just specified so we can add the game speed last
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ static void restartMissionMenu()
Int gameMode = TheGameLogic->getGameMode();
AsciiString mapName = TheGlobalData->m_mapName;

// TheSuperHackers @bugfix Caball009 07/02/2026 Reuse the previous seed value for the new skirmish match to prevent mismatches.
Comment thread
Caball009 marked this conversation as resolved.
// Campaign, challenge, and skirmish single-player scenarios all use GAME_SINGLE_PLAYER and are expected to use 0 as seed value.
DEBUG_ASSERTCRASH((TheSkirmishGameInfo != nullptr) == (gameMode == GAME_SKIRMISH), ("Unexpected game mode on map / mission restart"));
Comment thread
xezon marked this conversation as resolved.
const UnsignedInt seed = TheSkirmishGameInfo ? TheSkirmishGameInfo->getSeed() : 0;
Comment thread
xezon marked this conversation as resolved.
Outdated

//
// if the map name was from a save game it will have "Save/" at the front of it,
// we want to go back to the original pristine map string for the map name when restarting
Expand Down Expand Up @@ -238,11 +243,8 @@ static void restartMissionMenu()
TheScriptEngine->getGlobalDifficulty(),
rankPointsStartedWith)
);
//if (TheGlobalData->m_fixedSeed >= 0)
//InitRandom(TheGlobalData->m_fixedSeed);
InitRandom(0);
//else
// InitGameLogicRandom(GameClientRandomValue(0, INT_MAX - 1));

InitRandom(seed);
Comment thread
Caball009 marked this conversation as resolved.
Comment thread
Caball009 marked this conversation as resolved.
}
//TheTransitionHandler->remove("QuitFull"); //KRISMORNESS ADD
//quitMenuLayout = nullptr; //KRISMORNESS ADD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ void reallyDoStart( void )

TheWritableGlobalData->m_mapName = TheSkirmishGameInfo->getMap();
TheSkirmishGameInfo->startGame(0);
InitGameLogicRandom(TheSkirmishGameInfo->getSeed());

Bool isSkirmish = TRUE;
const MapMetaData *md = TheMapCache->findMap(TheSkirmishGameInfo->getMap());
Expand All @@ -442,6 +441,8 @@ void reallyDoStart( void )

if (isSkirmish)
{
InitGameLogicRandom(TheSkirmishGameInfo->getSeed());
Comment thread
Caball009 marked this conversation as resolved.

GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
msg->appendIntegerArgument(GAME_SKIRMISH);
msg->appendIntegerArgument(DIFFICULTY_NORMAL); // not really used; just specified so we can add the game speed last
Expand All @@ -450,6 +451,8 @@ void reallyDoStart( void )
}
else
{
InitGameLogicRandom(0);

GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
msg->appendIntegerArgument(GAME_SINGLE_PLAYER);
msg->appendIntegerArgument(DIFFICULTY_NORMAL); // not really used; just specified so we can add the game speed last
Expand Down
Loading