Skip to content

Commit 6e235c7

Browse files
committed
Fix game running slightly below UPS with OneSimUpdatePerFrame
1 parent 8702446 commit 6e235c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Managers/TimerMan.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ namespace RTE {
108108

109109
// Override the accumulator and just put one delta time in there so sim updates only once per frame.
110110
if (m_OneSimUpdatePerFrame) {
111-
// Only let it appear to go slower, not faster, if limited.
112-
if (m_SimSpeedLimited && m_SimAccumulator > m_DeltaTime) { m_SimAccumulator = m_DeltaTime; }
111+
// Make sure we don't get runaway behind
112+
if (m_SimSpeedLimited && m_SimAccumulator > m_DeltaTime * 2.0f) { m_SimAccumulator = m_DeltaTime; }
113113

114114
// Reset the counter of sim updates since the last drawn. it will always be 0 since every update results in a drawn frame.
115115
m_SimUpdatesSinceDrawn = -1;

0 commit comments

Comments
 (0)