Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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 @@ -53,7 +53,7 @@
#include "GameClient/GameWindowTransitions.h"
#include "GameClient/DisconnectMenu.h"
#include "GameLogic/ScriptEngine.h"

#include "GameLogic/LogicRandomValue.h"


// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -244,7 +244,13 @@ static void restartMissionMenu()
rankPointsStartedWith)
);

InitRandom(seed);
// TheSuperHackers @bugfix ViTeXFTW 26/02/26 Generate a new seed value if we are in a singleplayer match
// to avoid the same random events happening in the same order as previous match.
if (gameMode == GAME_SINGLE_PLAYER) {
Copy link
Author

@ViTeXFTW ViTeXFTW Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very hands-on handling of the Generals challenge issue but should work as they all have prefixes. The same can be done for mission maps. But that can interferre with custom maps if they decide to name their map something similar.

Suggested change
if (gameMode == GAME_SINGLE_PLAYER) {
if (gameMode == GAME_SINGLE_PLAYER && !mapName.startsWith("GC_")) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks brittle and doesn't work for campaign maps.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Campaign maps can be filtered with !mapName.startsWith("MD_");, but i agree this is a brittle solution

InitRandom(GameLogicRandomValue(0, INT_MAX - 1));
} else {
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 @@ -542,7 +542,7 @@ void Shell::showShellMap(Bool useShellMap )
TheGameLogic->exitGame();

TheWritableGlobalData->m_pendingFile = TheGlobalData->m_shellMapName;
InitGameLogicRandom(0);
InitGameLogicRandom(GameClientRandomValue(0, INT_MAX - 1));
GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
msg->appendIntegerArgument(GAME_SHELL);
m_shellMapOn = TRUE;
Expand Down
Loading