@@ -247,6 +247,10 @@ GameLogic::GameLogic()
247247#ifdef DUMP_PERF_STATS
248248 m_overallFailedPathfinds = 0 ;
249249#endif
250+
251+ m_loadingMap = FALSE ;
252+ m_loadingSave = FALSE ;
253+ m_clearingGameData = FALSE ;
250254}
251255
252256// -------------------------------------------------------------------------------------------------
@@ -933,11 +937,6 @@ void GameLogic::deleteLoadScreen()
933937
934938}
935939
936- void GameLogic::setGameLoading ( Bool loading )
937- {
938- m_loadingScene = loading;
939- }
940-
941940// ------------------------------------------------------------------------------------------------
942941// ------------------------------------------------------------------------------------------------
943942void GameLogic::updateDisplayBusyState ()
@@ -964,7 +963,7 @@ void GameLogic::setGameMode( GameMode mode )
964963/* * Entry point for starting a new game, the engine is already in clean state at this
965964 * point and ready to load up with all the data */
966965// ------------------------------------------------------------------------------------------------
967- void GameLogic::startNewGame ( Bool saveGame )
966+ void GameLogic::startNewGame ( Bool loadingSaveGame )
968967{
969968
970969 #ifdef DUMP_PERF_STATS
@@ -984,7 +983,9 @@ void GameLogic::startNewGame( Bool saveGame )
984983 CRCDebugStartNewGame ();
985984#endif
986985
987- if ( saveGame == FALSE )
986+ setLoadingMap ( TRUE );
987+
988+ if ( loadingSaveGame == FALSE )
988989 {
989990
990991 // record pristine map name when we're loading from the map (not a save game)
@@ -1015,7 +1016,7 @@ void GameLogic::startNewGame( Bool saveGame )
10151016 deleteInstance (m_background);
10161017 m_background = nullptr ;
10171018 }
1018- m_loadScreen = getLoadScreen ( saveGame );
1019+ m_loadScreen = getLoadScreen ( loadingSaveGame );
10191020 if (m_loadScreen)
10201021 {
10211022 TheWritableGlobalData->m_loadScreenRender = TRUE ; // /< mark it so only a few select things are rendered during load
@@ -1038,7 +1039,7 @@ void GameLogic::startNewGame( Bool saveGame )
10381039 // for save games, we read this value out of the save game file and it is important
10391040 // that we preserve it as we load and execute the game
10401041 //
1041- if ( saveGame == FALSE )
1042+ if ( loadingSaveGame == FALSE )
10421043 m_nextObjID = (ObjectID)1 ;
10431044
10441045 TheWritableGlobalData->m_loadScreenRender = TRUE ; // /< mark it so only a few select things are rendered during load
@@ -1079,7 +1080,7 @@ void GameLogic::startNewGame( Bool saveGame )
10791080 for (Int i=0 ; i<MAX_SLOTS; ++i)
10801081 {
10811082 GameSlot *slot = TheGameInfo->getSlot (i);
1082- if (!saveGame ) {
1083+ if (!loadingSaveGame ) {
10831084 slot->saveOffOriginalInfo ();
10841085 }
10851086 if (slot->isAI ())
@@ -1104,7 +1105,7 @@ void GameLogic::startNewGame( Bool saveGame )
11041105 // Get the m_loadScreen for this kind of game
11051106 if (!m_loadScreen && !(TheRecorder && TheRecorder->getMode () == RECORDERMODETYPE_SIMULATION_PLAYBACK))
11061107 {
1107- m_loadScreen = getLoadScreen ( saveGame );
1108+ m_loadScreen = getLoadScreen ( loadingSaveGame );
11081109 if (m_loadScreen && !TheGlobalData->m_headless )
11091110 {
11101111 TheMouse->setVisibility (FALSE );
@@ -1510,7 +1511,7 @@ void GameLogic::startNewGame( Bool saveGame )
15101511 updateLoadProgress (LOAD_PROGRESS_POST_GHOST_OBJECT_MANAGER_RESET);
15111512
15121513 // update the terrain logic now that all is loaded
1513- TheTerrainLogic->newMap ( saveGame );
1514+ TheTerrainLogic->newMap ( loadingSaveGame );
15141515
15151516 // update the loadscreen
15161517 updateLoadProgress (LOAD_PROGRESS_POST_TERRAIN_LOGIC_NEW_MAP);
@@ -1613,7 +1614,7 @@ void GameLogic::startNewGame( Bool saveGame )
16131614 DEBUG_LOG ((" %s" , Buf));
16141615 #endif
16151616
1616- if ( saveGame == FALSE )
1617+ if ( loadingSaveGame == FALSE )
16171618 {
16181619 Int progressCount = LOAD_PROGRESS_LOOP_ALL_THE_FREAKN_OBJECTS;
16191620 Int timer = timeGetTime ();
@@ -1716,7 +1717,7 @@ void GameLogic::startNewGame( Bool saveGame )
17161717 #endif
17171718
17181719 // place initial network buildings/units
1719- if (TheGameInfo && !saveGame )
1720+ if (TheGameInfo && !loadingSaveGame )
17201721 {
17211722 Int progressCount = LOAD_PROGRESS_LOOP_INITIAL_NETWORK_BUILDINGS;
17221723 for (int i=0 ; i<MAX_SLOTS; ++i)
@@ -1852,11 +1853,11 @@ void GameLogic::startNewGame( Bool saveGame )
18521853
18531854
18541855 // final step, run newMap for all players
1855- if ( saveGame == FALSE )
1856+ if ( loadingSaveGame == FALSE )
18561857 ThePlayerList->newMap ();
18571858
18581859 // reset all the skill points in a single player game
1859- if (saveGame == FALSE && isInSinglePlayerGame ())
1860+ if (loadingSaveGame == FALSE && isInSinglePlayerGame ())
18601861 {
18611862 for (Int i=0 ; i<MAX_PLAYER_COUNT; ++i)
18621863 {
@@ -1889,7 +1890,7 @@ void GameLogic::startNewGame( Bool saveGame )
18891890 }
18901891
18911892 // if we're in a load game, don't fade yet
1892- if (saveGame == FALSE && TheTransitionHandler != nullptr && m_loadScreen)
1893+ if (loadingSaveGame == FALSE && TheTransitionHandler != nullptr && m_loadScreen)
18931894 {
18941895 TheTransitionHandler->setGroup (" FadeWholeScreen" );
18951896 while (!TheTransitionHandler->isFinished ())
@@ -1915,7 +1916,7 @@ void GameLogic::startNewGame( Bool saveGame )
19151916 // have more work to do and the load screen will be deleted elsewhere after
19161917 // we're all done with the load game progress
19171918 //
1918- if( saveGame == FALSE )
1919+ if( loadingSaveGame == FALSE )
19191920*/
19201921 deleteLoadScreen ();
19211922
@@ -2048,7 +2049,8 @@ void GameLogic::startNewGame( Bool saveGame )
20482049 }
20492050
20502051 // ReAllows quit menu to work during loading scene
2051- setGameLoading (FALSE );
2052+ // setGameLoading(FALSE);
2053+ setLoadingMap ( FALSE );
20522054
20532055#ifdef DUMP_PERF_STATS
20542056 GetPrecisionTimer (&endTime64);
0 commit comments