Signal that we are inside the update phase in the right function

This commit is contained in:
ζeh Matt 2023-06-01 01:17:02 +03:00
parent 68485e20d0
commit 0f00ad2dd2
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
1 changed files with 5 additions and 3 deletions

View File

@ -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()