diff --git a/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h b/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h index 0993841d0a..5a138b5c19 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h +++ b/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h @@ -329,7 +329,6 @@ class GameLogic : public SubsystemInterface, public Snapshot ObjectID m_nextObjID; ///< For allocating object id's - void setDefaults( Bool saveGame ); ///< Set default values of class object void processDestroyList( void ); ///< Destroy all pending objects on the destroy list void destroyAllObjectsImmediate(); ///< destroy, and process destroy list immediately diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index dbfb226078..1b2fa9b864 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -249,36 +249,6 @@ GameLogic::GameLogic( void ) #endif } -// ------------------------------------------------------------------------------------------------ -/** Utility function to set class variables to default values. */ -// ------------------------------------------------------------------------------------------------ -void GameLogic::setDefaults( Bool saveGame ) -{ - m_frame = 0; - m_hasUpdated = FALSE; - m_width = DEFAULT_WORLD_WIDTH; - m_height = DEFAULT_WORLD_HEIGHT; - m_objList = NULL; -#ifdef ALLOW_NONSLEEPY_UPDATES - m_normalUpdates.clear(); -#endif - for (std::vector::iterator it = m_sleepyUpdates.begin(); it != m_sleepyUpdates.end(); ++it) - { - (*it)->friend_setIndexInLogic(-1); - } - m_sleepyUpdates.clear(); - m_curUpdateModule = NULL; - - // - // only reset the next object ID allocater counter when we're not loading a save game. - // for save games, we read this value out of the save game file and it is important - // that we preserve it as we load and execute the game - // - if( saveGame == FALSE ) - m_nextObjID = (ObjectID)1; - -} - //------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------- Bool GameLogic::isInSinglePlayerGame( void ) @@ -370,9 +340,6 @@ void GameLogic::init( void ) setFPMode(); - /// @todo Clear object and destroy lists - setDefaults( FALSE ); - // create the partition manager ThePartitionManager = NEW PartitionManager; ThePartitionManager->init(); @@ -400,32 +367,8 @@ void GameLogic::init( void ) //DEBUG_ASSERTCRASH(ThePlayerList, ("null ThePlayerList")); //ThePlayerList->setLocalPlayer(0); - m_CRC = 0; - m_pauseFrame = 0; - m_gamePaused = FALSE; - m_pauseSound = FALSE; - m_pauseMusic = FALSE; - m_pauseInput = FALSE; - m_inputEnabledMemory = TRUE; - m_mouseVisibleMemory = TRUE; - m_logicTimeScaleEnabledMemory = FALSE; - - for(Int i = 0; i < MAX_SLOTS; ++i) - { - m_progressComplete[i] = FALSE; - m_progressCompleteTimeout[i] = 0; - } - m_forceGameStartByTimeOut = FALSE; - - m_isScoringEnabled = TRUE; - m_showBehindBuildingMarkers = TRUE; - m_drawIconUI = TRUE; - m_showDynamicLOD = TRUE; - m_scriptHulkMaxLifetimeOverride = -1; - + reset(); m_isInUpdate = FALSE; - - m_rankPointsToAddAtGameStart = 0; } //------------------------------------------------------------------------------------------------- @@ -482,7 +425,20 @@ void GameLogic::reset( void ) // clear any table of contents we have m_objectTOC.clear(); - setDefaults( FALSE ); + m_frame = 0; + m_hasUpdated = FALSE; + m_width = DEFAULT_WORLD_WIDTH; + m_height = DEFAULT_WORLD_HEIGHT; + m_objList = NULL; +#ifdef ALLOW_NONSLEEPY_UPDATES + m_normalUpdates.clear(); +#endif + for (std::vector::iterator it = m_sleepyUpdates.begin(); it != m_sleepyUpdates.end(); ++it) + { + (*it)->friend_setIndexInLogic(-1); + } + m_sleepyUpdates.clear(); + m_curUpdateModule = NULL; m_isScoringEnabled = TRUE; m_showBehindBuildingMarkers = TRUE; @@ -1076,17 +1032,19 @@ void GameLogic::startNewGame( Bool saveGame ) } m_rankLevelLimit = 1000; // this is reset every game. - setDefaults( saveGame ); + + // + // only reset the next object ID allocater counter when we're not loading a save game. + // for save games, we read this value out of the save game file and it is important + // that we preserve it as we load and execute the game + // + if( saveGame == FALSE ) + m_nextObjID = (ObjectID)1; + TheWritableGlobalData->m_loadScreenRender = TRUE; ///< mark it so only a few select things are rendered during load TheWritableGlobalData->m_TiVOFastMode = FALSE; //always disable the TIVO fast-forward mode at the start of a new game. - m_showBehindBuildingMarkers = TRUE; - m_drawIconUI = TRUE; - m_showDynamicLOD = TRUE; - m_scriptHulkMaxLifetimeOverride = -1; - // Fill in the game color and Factions before we do the Load Screen - GameInfo *game = NULL; TheGameInfo = NULL; Int localSlot = 0; if (TheNetwork) @@ -1094,41 +1052,40 @@ void GameLogic::startNewGame( Bool saveGame ) if (TheLAN) { DEBUG_LOG(("Starting network game")); - TheGameInfo = game = TheLAN->GetMyGame(); + TheGameInfo = TheLAN->GetMyGame(); } else { DEBUG_LOG(("Starting gamespy game")); - TheGameInfo = game = TheGameSpyGame; /// @todo: MDC add back in after demo + TheGameInfo = TheGameSpyGame; /// @todo: MDC add back in after demo } } else { if (TheRecorder && TheRecorder->isPlaybackMode()) { - TheGameInfo = game = TheRecorder->getGameInfo(); + TheGameInfo = TheRecorder->getGameInfo(); } else if(m_gameMode == GAME_SKIRMISH) { - TheGameInfo = game = TheSkirmishGameInfo; + TheGameInfo = TheSkirmishGameInfo; } } - checkForDuplicateColors( game ); + checkForDuplicateColors( TheGameInfo ); Bool isSkirmishOrSkirmishReplay = FALSE; - if (game) + if (TheGameInfo) { for (Int i=0; igetSlot(i); + GameSlot *slot = TheGameInfo->getSlot(i); if (!saveGame) { slot->saveOffOriginalInfo(); } if (slot->isAI()) { isSkirmishOrSkirmishReplay = TRUE; - continue; } } } else { @@ -1138,8 +1095,8 @@ void GameLogic::startNewGame( Bool saveGame ) } } - populateRandomSideAndColor( game ); - populateRandomStartPosition( game ); + populateRandomSideAndColor( TheGameInfo ); + populateRandomStartPosition( TheGameInfo ); //****************************// // Start the LoadScreen Now! // @@ -1152,7 +1109,7 @@ void GameLogic::startNewGame( Bool saveGame ) if(m_loadScreen && !TheGlobalData->m_headless) { TheMouse->setVisibility(FALSE); - m_loadScreen->init(game); + m_loadScreen->init(TheGameInfo); updateLoadProgress( LOAD_PROGRESS_START ); } @@ -1194,7 +1151,7 @@ void GameLogic::startNewGame( Bool saveGame ) #endif Int progressCount = LOAD_PROGRESS_SIDE_POPULATION; - if (game) + if (TheGameInfo) { if (TheGameEngine->isMultiplayerSession() || isSkirmishOrSkirmishReplay) @@ -1203,12 +1160,12 @@ void GameLogic::startNewGame( Bool saveGame ) TheSidesList->prepareForMP_or_Skirmish(); } - //DEBUG_LOG(("Starting LAN game with %d players", game->getNumPlayers())); + //DEBUG_LOG(("Starting LAN game with %d players", TheGameInfo->getNumPlayers())); Dict d; for (int i=0; igetSlot(i); + GameSlot *slot = TheGameInfo->getSlot(i); if (!slot || !slot->isHuman()) { @@ -1235,7 +1192,7 @@ void GameLogic::startNewGame( Bool saveGame ) d.setAsciiString(TheKey_playerFaction, KEYNAME(pt->getNameKey())); } - if (game->isPlayerPreorder(i)) + if (TheGameInfo->isPlayerPreorder(i)) { d.setBool(TheKey_playerIsPreorder, TRUE); } @@ -1245,7 +1202,7 @@ void GameLogic::startNewGame( Bool saveGame ) DEBUG_LOG(("Looking for allies of player %d, team %d", i, team)); for(int j=0; j < MAX_SLOTS; ++j) { - GameSlot *teamSlot = game->getSlot(j); + GameSlot *teamSlot = TheGameInfo->getSlot(j); // for check to see if we're trying to add ourselves if(i == j || !teamSlot->isOccupied()) continue; @@ -1299,7 +1256,7 @@ void GameLogic::startNewGame( Bool saveGame ) d.setInt(TheKey_multiplayerStartIndex, slot->getStartPos()); // d.setBool(TheKey_multiplayerIsLocal, slot->isLocalPlayer()); // d.setBool(TheKey_multiplayerIsLocal, slot->getIP() == game->getLocalIP()); - d.setBool(TheKey_multiplayerIsLocal, slot->isHuman() && (slot->getName().compare(game->getSlot(game->getLocalSlotNum())->getName().str()) == 0)); + d.setBool(TheKey_multiplayerIsLocal, slot->isHuman() && (slot->getName().compare(TheGameInfo->getSlot(TheGameInfo->getLocalSlotNum())->getName().str()) == 0)); /* if (slot->getIP() == game->getLocalIP()) @@ -1322,7 +1279,7 @@ void GameLogic::startNewGame( Bool saveGame ) AsciiString slotNameAscii; slotNameAscii.translate(slot->getName()); - if (slot->isHuman() && game->getSlotNum(slotNameAscii) == game->getLocalSlotNum()) { + if (slot->isHuman() && TheGameInfo->getSlotNum(slotNameAscii) == TheGameInfo->getLocalSlotNum()) { localSlot = i; } TheSidesList->addSide(&d); @@ -1392,11 +1349,11 @@ void GameLogic::startNewGame( Bool saveGame ) // if there are no other teams (happens for debugging) don't end the game immediately Int numTeams = 0; // this can be higher than expected, but is accurate for determining 0, 1, 2+ Int lastTeam = -1; - if (game) + if (TheGameInfo) { for (int i=0; igetConstSlot(i); + const GameSlot *slot = TheGameInfo->getConstSlot(i); if (slot->isOccupied() && slot->getPlayerTemplate() != PLAYERTEMPLATE_OBSERVER) { if (slot->getTeamNumber() == -1 || slot->getTeamNumber() != lastTeam) @@ -1625,11 +1582,11 @@ void GameLogic::startNewGame( Bool saveGame ) ThePartitionManager->revealMapForPlayerPermanently( observerPlayer->getPlayerIndex() ); DEBUG_LOG(("Reveal shroud for %ls whose index is %d", observerPlayer->getPlayerDisplayName().str(), observerPlayer->getPlayerIndex())); - if (game) + if (TheGameInfo) { for (int i=0; igetSlot(i); + GameSlot *slot = TheGameInfo->getSlot(i); if (!slot || !slot->isOccupied()) continue; @@ -1763,11 +1720,11 @@ void GameLogic::startNewGame( Bool saveGame ) progressCount = LOAD_PROGRESS_LOOP_INITIAL_NETWORK_BUILDINGS; // place initial network buildings/units - if (game && !saveGame) + if (TheGameInfo && !saveGame) { for (int i=0; igetSlot(i); + GameSlot *slot = TheGameInfo->getSlot(i); if (!slot || !slot->isOccupied()) continue; @@ -1842,9 +1799,9 @@ void GameLogic::startNewGame( Bool saveGame ) // Note - We construct the multiplayer start spot name manually here, so change this if you // change TheKey_Player_1_Start etc. mdc AsciiString startingCamName = TheNameKeyGenerator->keyToName(TheKey_InitialCameraPosition); - if (game) + if (TheGameInfo) { - GameSlot *slot = game->getSlot(localSlot); + GameSlot *slot = TheGameInfo->getSlot(localSlot); DEBUG_ASSERTCRASH(slot, ("Starting a LAN game without ourselves!")); if (slot->isHuman()) diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h index 420142129b..c4f7e13073 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h @@ -353,7 +353,6 @@ class GameLogic : public SubsystemInterface, public Snapshot ObjectID m_nextObjID; ///< For allocating object id's - void setDefaults( Bool loadSaveGame ); ///< Set default values of class object void processDestroyList( void ); ///< Destroy all pending objects on the destroy list void destroyAllObjectsImmediate(); ///< destroy, and process destroy list immediately diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index c729fb81cd..67a23d92c0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -264,36 +264,6 @@ GameLogic::GameLogic( void ) m_clearingGameData = FALSE; } -// ------------------------------------------------------------------------------------------------ -/** Utility function to set class variables to default values. */ -// ------------------------------------------------------------------------------------------------ -void GameLogic::setDefaults( Bool loadingSaveGame ) -{ - m_frame = 0; - m_hasUpdated = FALSE; - m_width = DEFAULT_WORLD_WIDTH; - m_height = DEFAULT_WORLD_HEIGHT; - m_objList = NULL; -#ifdef ALLOW_NONSLEEPY_UPDATES - m_normalUpdates.clear(); -#endif - for (std::vector::iterator it = m_sleepyUpdates.begin(); it != m_sleepyUpdates.end(); ++it) - { - (*it)->friend_setIndexInLogic(-1); - } - m_sleepyUpdates.clear(); - m_curUpdateModule = NULL; - - // - // only reset the next object ID allocater counter when we're not loading a save game. - // for save games, we read this value out of the save game file and it is important - // that we preserve it as we load and execute the game - // - if( loadingSaveGame == FALSE ) - m_nextObjID = (ObjectID)1; - -} - //------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------- Bool GameLogic::isInSinglePlayerGame( void ) @@ -385,9 +355,6 @@ void GameLogic::init( void ) setFPMode(); - /// @todo Clear object and destroy lists - setDefaults( FALSE ); - // create the partition manager ThePartitionManager = NEW PartitionManager; ThePartitionManager->init(); @@ -414,33 +381,8 @@ void GameLogic::init( void ) // create a team for the player //DEBUG_ASSERTCRASH(ThePlayerList, ("null ThePlayerList")); //ThePlayerList->setLocalPlayer(0); - - m_CRC = 0; - m_pauseFrame = 0; - m_gamePaused = FALSE; - m_pauseSound = FALSE; - m_pauseMusic = FALSE; - m_pauseInput = FALSE; - m_inputEnabledMemory = TRUE; - m_mouseVisibleMemory = TRUE; - m_logicTimeScaleEnabledMemory = FALSE; - - for(Int i = 0; i < MAX_SLOTS; ++i) - { - m_progressComplete[i] = FALSE; - m_progressCompleteTimeout[i] = 0; - } - m_forceGameStartByTimeOut = FALSE; - - m_isScoringEnabled = TRUE; - m_showBehindBuildingMarkers = TRUE; - m_drawIconUI = TRUE; - m_showDynamicLOD = TRUE; - m_scriptHulkMaxLifetimeOverride = -1; - + reset(); m_isInUpdate = FALSE; - - m_rankPointsToAddAtGameStart = 0; } //------------------------------------------------------------------------------------------------- @@ -495,7 +437,20 @@ void GameLogic::reset( void ) // clear any table of contents we have m_objectTOC.clear(); - setDefaults( FALSE ); + m_frame = 0; + m_hasUpdated = FALSE; + m_width = DEFAULT_WORLD_WIDTH; + m_height = DEFAULT_WORLD_HEIGHT; + m_objList = NULL; +#ifdef ALLOW_NONSLEEPY_UPDATES + m_normalUpdates.clear(); +#endif + for (std::vector::iterator it = m_sleepyUpdates.begin(); it != m_sleepyUpdates.end(); ++it) + { + (*it)->friend_setIndexInLogic(-1); + } + m_sleepyUpdates.clear(); + m_curUpdateModule = NULL; m_isScoringEnabled = TRUE; m_showBehindBuildingMarkers = TRUE; @@ -1215,20 +1170,22 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) } m_rankLevelLimit = 1000; // this is reset every game. - setDefaults( loadingSaveGame ); + + // + // only reset the next object ID allocater counter when we're not loading a save game. + // for save games, we read this value out of the save game file and it is important + // that we preserve it as we load and execute the game + // + if( loadingSaveGame == FALSE ) + m_nextObjID = (ObjectID)1; + TheWritableGlobalData->m_loadScreenRender = TRUE; ///< mark it so only a few select things are rendered during load TheWritableGlobalData->m_TiVOFastMode = FALSE; //always disable the TIVO fast-forward mode at the start of a new game. - m_showBehindBuildingMarkers = TRUE; - m_drawIconUI = TRUE; - m_showDynamicLOD = TRUE; - m_scriptHulkMaxLifetimeOverride = -1; - Campaign* currentCampaign = TheCampaignManager->getCurrentCampaign(); Bool isChallengeCampaign = m_gameMode == GAME_SINGLE_PLAYER && currentCampaign && currentCampaign->m_isChallengeCampaign; // Fill in the game color and Factions before we do the Load Screen - GameInfo *game = NULL; TheGameInfo = NULL; Int localSlot = 0; if (TheNetwork) @@ -1236,27 +1193,27 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) if (TheLAN) { DEBUG_LOG(("Starting network game")); - TheGameInfo = game = TheLAN->GetMyGame(); + TheGameInfo = TheLAN->GetMyGame(); } else { DEBUG_LOG(("Starting gamespy game")); - TheGameInfo = game = TheGameSpyGame; /// @todo: MDC add back in after demo + TheGameInfo = TheGameSpyGame; /// @todo: MDC add back in after demo } } else { if (TheRecorder && TheRecorder->isPlaybackMode()) { - TheGameInfo = game = TheRecorder->getGameInfo(); + TheGameInfo = TheRecorder->getGameInfo(); } else if(m_gameMode == GAME_SKIRMISH) { - TheGameInfo = game = TheSkirmishGameInfo; + TheGameInfo = TheSkirmishGameInfo; } else if(isChallengeCampaign) { - TheGameInfo = game = TheChallengeGameInfo; + TheGameInfo = TheChallengeGameInfo; } } @@ -1276,21 +1233,20 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) } } - checkForDuplicateColors( game ); + checkForDuplicateColors( TheGameInfo ); Bool isSkirmishOrSkirmishReplay = FALSE; - if (game) + if (TheGameInfo) { for (Int i=0; igetSlot(i); + GameSlot *slot = TheGameInfo->getSlot(i); if (!loadingSaveGame) { slot->saveOffOriginalInfo(); } if (slot->isAI()) { isSkirmishOrSkirmishReplay = TRUE; - continue; } } } else { @@ -1300,8 +1256,8 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) } } - populateRandomSideAndColor( game ); - populateRandomStartPosition( game ); + populateRandomSideAndColor( TheGameInfo ); + populateRandomStartPosition( TheGameInfo ); //****************************// // Start the LoadScreen Now! // @@ -1314,7 +1270,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) if(m_loadScreen) { TheMouse->setVisibility(FALSE); - m_loadScreen->init(game); + m_loadScreen->init(TheGameInfo); updateLoadProgress( LOAD_PROGRESS_START ); } @@ -1356,7 +1312,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) #endif Int progressCount = LOAD_PROGRESS_SIDE_POPULATION; - if (game) + if (TheGameInfo) { if (TheGameEngine->isMultiplayerSession() || isSkirmishOrSkirmishReplay) @@ -1370,7 +1326,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) for (int i=0; igetSlot(i); + GameSlot *slot = TheGameInfo->getSlot(i); if (!slot || !slot->isHuman()) { @@ -1397,7 +1353,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) d.setAsciiString(TheKey_playerFaction, KEYNAME(pt->getNameKey())); } - if (game->isPlayerPreorder(i)) + if (TheGameInfo->isPlayerPreorder(i)) { d.setBool(TheKey_playerIsPreorder, TRUE); } @@ -1407,7 +1363,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) DEBUG_LOG(("Looking for allies of player %d, team %d", i, team)); for(int j=0; j < MAX_SLOTS; ++j) { - GameSlot *teamSlot = game->getSlot(j); + GameSlot *teamSlot = TheGameInfo->getSlot(j); // for check to see if we're trying to add ourselves if(i == j || !teamSlot->isOccupied()) continue; @@ -1461,7 +1417,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) d.setInt(TheKey_multiplayerStartIndex, slot->getStartPos()); // d.setBool(TheKey_multiplayerIsLocal, slot->isLocalPlayer()); // d.setBool(TheKey_multiplayerIsLocal, slot->getIP() == game->getLocalIP()); - d.setBool(TheKey_multiplayerIsLocal, slot->isHuman() && (slot->getName().compare(game->getSlot(game->getLocalSlotNum())->getName().str()) == 0)); + d.setBool(TheKey_multiplayerIsLocal, slot->isHuman() && (slot->getName().compare(TheGameInfo->getSlot(TheGameInfo->getLocalSlotNum())->getName().str()) == 0)); /* if (slot->getIP() == game->getLocalIP()) @@ -1484,7 +1440,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) AsciiString slotNameAscii; slotNameAscii.translate(slot->getName()); - if (slot->isHuman() && game->getSlotNum(slotNameAscii) == game->getLocalSlotNum()) { + if (slot->isHuman() && TheGameInfo->getSlotNum(slotNameAscii) == TheGameInfo->getLocalSlotNum()) { localSlot = i; } TheSidesList->addSide(&d); @@ -1554,11 +1510,11 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) // if there are no other teams (happens for debugging) don't end the game immediately Int numTeams = 0; // this can be higher than expected, but is accurate for determining 0, 1, 2+ Int lastTeam = -1; - if (game) + if (TheGameInfo) { for (int i=0; igetConstSlot(i); + const GameSlot *slot = TheGameInfo->getConstSlot(i); if (slot->isOccupied() && slot->getPlayerTemplate() != PLAYERTEMPLATE_OBSERVER) { if (slot->getTeamNumber() == -1 || slot->getTeamNumber() != lastTeam) @@ -1787,11 +1743,11 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) ThePartitionManager->revealMapForPlayerPermanently( observerPlayer->getPlayerIndex() ); DEBUG_LOG(("Reveal shroud for %ls whose index is %d", observerPlayer->getPlayerDisplayName().str(), observerPlayer->getPlayerIndex())); - if (game) + if (TheGameInfo) { for (int i=0; igetSlot(i); + GameSlot *slot = TheGameInfo->getSlot(i); if (!slot || !slot->isOccupied()) continue; @@ -1977,11 +1933,11 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) progressCount = LOAD_PROGRESS_LOOP_INITIAL_NETWORK_BUILDINGS; // place initial network buildings/units - if (game && !loadingSaveGame) + if (TheGameInfo && !loadingSaveGame) { for (int i=0; igetSlot(i); + GameSlot *slot = TheGameInfo->getSlot(i); if (!slot || !slot->isOccupied()) continue; @@ -2032,7 +1988,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) // Trouble was that skirmish games would get no command centers upon start, if this was set true in a GameSpyMenu if ( isInInternetGame() ) { - if ( game->oldFactionsOnly() && !pt->isOldFaction() ) + if ( TheGameInfo->oldFactionsOnly() && !pt->isOldFaction() ) continue; } @@ -2083,9 +2039,9 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) // Note - We construct the multiplayer start spot name manually here, so change this if you // change TheKey_Player_1_Start etc. mdc AsciiString startingCamName = TheNameKeyGenerator->keyToName(TheKey_InitialCameraPosition); - if (game) + if (TheGameInfo) { - GameSlot *slot = game->getSlot(localSlot); + GameSlot *slot = TheGameInfo->getSlot(localSlot); DEBUG_ASSERTCRASH(slot, ("Starting a LAN game without ourselves!")); if (slot->isHuman())