Skip to content

Commit 3b823a7

Browse files
committed
Fixed div by zero
1 parent 4fd7a6b commit 3b823a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Managers/TimerMan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ namespace RTE {
106106
m_SimAccumulator += static_cast<long long>(static_cast<float>(timeIncrease) * m_TimeScale);
107107
}
108108

109-
float maxPossibleSimSpeed = GetDeltaTimeMS() / g_PerformanceMan.GetMSPSUAverage();
109+
float maxPossibleSimSpeed = GetDeltaTimeMS() / std::max(g_PerformanceMan.GetMSPSUAverage(), std::numeric_limits<float>::epsilon());
110110

111111
// Make sure we don't get runaway behind schedule
112112
m_SimAccumulator = std::min(m_SimAccumulator, m_DeltaTime + static_cast<long long>(m_DeltaTime * maxPossibleSimSpeed));

0 commit comments

Comments
 (0)