Add clarification around GameLoadInit calls

This commit is contained in:
Aaron van Geffen committed 2026-06-27 14:59:08 +02:00
1 parent 35180cbefe
commit bd3d24b181
10 files changed
+10 -9

No files matched your search

@@ -308,7 +308,7 @@ namespace OpenRCT2::Scripting
if (isScenario)
ScenarioBegin(gameState);
else
GameLoadInit();
GameLoadInit(); // NB: calls `setActiveScene`
gLoadKeepWindowsOpen = old;
}
catch (const std::exception&)
+1 -1
View File
@@ -809,7 +809,7 @@ namespace OpenRCT2
_network.Close();
}
#endif
GameLoadInit();
GameLoadInit(); // NB: calls `setActiveScene`
#ifndef DISABLE_NETWORK
if (_network.GetMode() == Network::Mode::server)
{
+1
View File
@@ -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());
+1 -1
View File
@@ -552,7 +552,7 @@ namespace OpenRCT2
DataSerialiser parkParamsDs(false, data.parkParams);
SerialiseParkParameters(parkParamsDs);
GameLoadInit();
GameLoadInit(); // NB: calls `setActiveScene`
FixInvalidVehicleSpriteSizes();
}
catch (const std::exception& ex)
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -37,7 +37,7 @@ public:
std::string parkPath = TestData::GetParkPath("pathfinding-tests.sv6");
GetContext()->LoadParkFromFile(parkPath);
GameLoadInit();
GameLoadInit(); // NB: calls `setActiveScene`
}
void SetUp() override
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;