mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #16335 from ZehMatt/fix-16324
Fix #16324: Real time ticks advancing every millisecond
This commit is contained in:
commit
e9f79f1c9d
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue