diff --git a/src/openrct2-ui/scripting/ScTitleSequence.hpp b/src/openrct2-ui/scripting/ScTitleSequence.hpp index c998877b57..d759f57f16 100644 --- a/src/openrct2-ui/scripting/ScTitleSequence.hpp +++ b/src/openrct2-ui/scripting/ScTitleSequence.hpp @@ -308,7 +308,7 @@ namespace OpenRCT2::Scripting if (isScenario) ScenarioBegin(gameState); else - GameLoadInit(); + GameLoadInit(); // NB: calls `setActiveScene` gLoadKeepWindowsOpen = old; } catch (const std::exception&) diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 85ba85126a..9ae95b3dac 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -809,7 +809,7 @@ namespace OpenRCT2 _network.Close(); } #endif - GameLoadInit(); + GameLoadInit(); // NB: calls `setActiveScene` #ifndef DISABLE_NETWORK if (_network.GetMode() == Network::Mode::server) { diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index c77186421b..ace851a427 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -361,6 +361,7 @@ void GameLoadInit() IGameStateSnapshots* snapshots = context->GetGameStateSnapshots(); snapshots->Reset(); + // TODO: move this to caller sites?? auto* sceneMgr = context->GetSceneManager(); sceneMgr->setActiveScene(sceneMgr->getGameScene()); diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index 9f749bb6e5..bd9fef4f42 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -552,7 +552,7 @@ namespace OpenRCT2 DataSerialiser parkParamsDs(false, data.parkParams); SerialiseParkParameters(parkParamsDs); - GameLoadInit(); + GameLoadInit(); // NB: calls `setActiveScene` FixInvalidVehicleSpriteSizes(); } catch (const std::exception& ex) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 081a98f2fe..78689cffc4 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -2824,7 +2824,7 @@ namespace OpenRCT2::Network auto ms = MemoryStream(packet.data.data(), packet.data.size()); if (LoadMap(&ms)) { - GameLoadInit(); + GameLoadInit(); // NB: calls `setActiveScene` GameLoadScripts(); GameNotifyMapChanged(); diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index c5b869fa91..5668d27b19 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -79,7 +79,7 @@ static void ScenarioCheckObjective(GameState_t& gameState); void ScenarioBegin(GameState_t& gameState) { - GameLoadInit(); + GameLoadInit(); // NB: calls `setActiveScene` ScenarioReset(gameState); if (gameState.scenarioOptions.objective.Type != ObjectiveType::none && !gLoadKeepWindowsOpen) diff --git a/test/tests/MultiLaunch.cpp b/test/tests/MultiLaunch.cpp index adfdfd1de2..f829fcb0cd 100644 --- a/test/tests/MultiLaunch.cpp +++ b/test/tests/MultiLaunch.cpp @@ -36,7 +36,7 @@ TEST(MultiLaunchTest, all) ASSERT_TRUE(initialised); GetContext()->LoadParkFromFile(path); - GameLoadInit(); + GameLoadInit(); // NB: calls `setActiveScene` // Check ride count to check load was successful ASSERT_EQ(RideGetCount(), 134); diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index 534ed7137d..f7e1e84707 100644 --- a/test/tests/Pathfinding.cpp +++ b/test/tests/Pathfinding.cpp @@ -37,7 +37,7 @@ public: std::string parkPath = TestData::GetParkPath("pathfinding-tests.sv6"); GetContext()->LoadParkFromFile(parkPath); - GameLoadInit(); + GameLoadInit(); // NB: calls `setActiveScene` } void SetUp() override diff --git a/test/tests/TileElements.cpp b/test/tests/TileElements.cpp index 5fd987e132..2c23dcf7a2 100644 --- a/test/tests/TileElements.cpp +++ b/test/tests/TileElements.cpp @@ -35,7 +35,7 @@ protected: ASSERT_TRUE(initialised); GetContext()->LoadParkFromFile(parkPath); - GameLoadInit(); + GameLoadInit(); // NB: calls `setActiveScene` // Changed in some tests. Store to restore its value _gLegacyScene = gLegacyScene; diff --git a/test/tests/TileElementsView.cpp b/test/tests/TileElementsView.cpp index 943288f786..345b3e8008 100644 --- a/test/tests/TileElementsView.cpp +++ b/test/tests/TileElementsView.cpp @@ -42,7 +42,7 @@ protected: ASSERT_TRUE(initialised); GetContext()->LoadParkFromFile(parkPath); - GameLoadInit(); + GameLoadInit(); // NB: calls `setActiveScene` // Changed in some tests. Store to restore its value _gLegacyScene = gLegacyScene;