mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-04 13:42:55 +01:00
Signal that we are inside the update phase in the right function
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user