From 0f00ad2dd2242020c5fe7212cd126b3f1892ff69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 1 Jun 2023 01:17:02 +0300 Subject: [PATCH] Signal that we are inside the update phase in the right function --- src/openrct2/GameState.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index 7a419840c3..45d01d0836 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -109,8 +109,6 @@ void GameState::Tick() { PROFILED_FUNCTION(); - gInUpdateCode = true; - // Normal game play will update only once every GAME_UPDATE_TIME_MS uint32_t numUpdates = 1; @@ -250,7 +248,6 @@ void GameState::Tick() } gDoSingleUpdate = false; - gInUpdateCode = false; } void GameState::UpdateLogic(LogicTimings* timings) @@ -266,6 +263,8 @@ void GameState::UpdateLogic(LogicTimings* timings) } }; + gInUpdateCode = true; + gScreenAge++; if (gScreenAge == 0) gScreenAge--; @@ -290,6 +289,7 @@ void GameState::UpdateLogic(LogicTimings* timings) // Don't run past the server, this condition can happen during map changes. if (NetworkGetServerTick() == gCurrentTicks) { + gInUpdateCode = false; return; } @@ -397,6 +397,8 @@ void GameState::UpdateLogic(LogicTimings* timings) { timings->CurrentIdx = (timings->CurrentIdx + 1) % LOGIC_UPDATE_MEASUREMENTS_COUNT; } + + gInUpdateCode = false; } void GameState::CreateStateSnapshot()