Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 0 additions & 1 deletion Core/GameEngine/Include/Common/RandomValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

extern void InitRandom( void );
extern void InitRandom( UnsignedInt seed );
Comment thread
Caball009 marked this conversation as resolved.
Outdated
extern void InitGameLogicRandom( UnsignedInt seed ); ///< Set the GameLogic seed to a known value at game start
extern UnsignedInt GetGameLogicRandomSeed( void ); ///< Get the seed (used for replays)
extern UnsignedInt GetGameLogicRandomSeedCRC( void );///< Get the seed (used for CRCs)

Expand Down
15 changes: 0 additions & 15 deletions Core/GameEngine/Source/Common/RandomValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,21 +177,6 @@ DEBUG_LOG(( "InitRandom %08lx",seed));
#endif
}

void InitGameLogicRandom( UnsignedInt seed )
{
#ifdef DETERMINISTIC
Comment thread
Caball009 marked this conversation as resolved.
// needs to be the same every time
seedRandom(0, theGameLogicSeed);
theGameLogicBaseSeed = 0;
#else
seedRandom(seed, theGameLogicSeed);
theGameLogicBaseSeed = seed;
#endif
#ifdef DEBUG_RANDOM_LOGIC
DEBUG_LOG(( "InitRandom Logic %08lx",seed));
#endif
}

//
// Integer random value
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,9 +852,9 @@ void GameSpyStagingRoom::launchGame( void )

TheWritableGlobalData->m_useFpsLimit = false;

// Set the random seed
InitGameLogicRandom( getSeed() );
DEBUG_LOG(("InitGameLogicRandom( %d )", getSeed()));
// Set the seeds
InitRandom( getSeed() );
DEBUG_LOG(("InitRandom( %d )", getSeed()));

// mark us as "Loading" in the buddy list
BuddyRequest req;
Expand Down
6 changes: 3 additions & 3 deletions Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ void LANAPI::OnGameStart( void )

TheWritableGlobalData->m_useFpsLimit = false;

// Set the random seed
InitGameLogicRandom( m_currentGame->getSeed() );
DEBUG_LOG(("InitGameLogicRandom( %d )", m_currentGame->getSeed()));
// Set the seeds
InitRandom( m_currentGame->getSeed() );
DEBUG_LOG(("InitRandom( %d )", m_currentGame->getSeed()));
}
}

Expand Down
1 change: 0 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,6 @@ Bool RecorderClass::playbackFile(AsciiString filename)
if( maxFPS != 0 )
msg->appendIntegerArgument(maxFPS);
TheCommandList->appendMessage( msg );
//InitGameLogicRandom( m_gameInfo.getSeed());
InitRandom( m_gameInfo.getSeed() );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,7 @@ static void doGameStart( void )
msg->appendIntegerArgument(s_AIDiff);
msg->appendIntegerArgument(0);

/// @todo: when Campaign & skirmish are separated, make campaign have fixed seed and skirmish random.
InitRandom(0);
/*
if (TheGlobalData->m_fixedSeed >= 0)
Comment thread
Caball009 marked this conversation as resolved.
InitGameLogicRandom(TheGlobalData->m_fixedSeed);
else
InitGameLogicRandom(GameClientRandomValue(0, INT_MAX - 1));
*/

isShuttingDown = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ void reallyDoStart( void )

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

GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
msg->appendIntegerArgument(GAME_SKIRMISH);
Expand All @@ -451,7 +451,7 @@ void reallyDoStart( void )
}
else
{
InitGameLogicRandom(0);
InitRandom(0);

GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
msg->appendIntegerArgument(GAME_SINGLE_PLAYER);
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);
InitRandom(0);
GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
msg->appendIntegerArgument(GAME_SHELL);
m_shellMapOn = TRUE;
Expand Down
Loading