Merge pull request #16335 from ZehMatt/fix-16324

Fix #16324: Real time ticks advancing every millisecond
This commit is contained in:
ζeh Matt 2021-12-30 16:39:03 -08:00 committed by GitHub
commit e9f79f1c9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -1032,13 +1032,10 @@ namespace OpenRCT2
// Real Time.
_realtimeAccumulator = std::min(_realtimeAccumulator + deltaTime, GAME_UPDATE_MAX_THRESHOLD);
// The game works with milliseconds as integers so we need to compensate.
constexpr auto _1Ms = 1.0f / 1000.0f;
while (_realtimeAccumulator >= _1Ms)
while (_realtimeAccumulator >= GAME_UPDATE_TIME_MS)
{
gCurrentRealTimeTicks++;
_realtimeAccumulator -= _1Ms;
_realtimeAccumulator -= GAME_UPDATE_TIME_MS;
}
}