1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-29 07:11:34 +00:00

Avoid the 'spiral of death'

This commit is contained in:
scrawl 2016-02-13 03:09:28 +01:00
parent 383524c688
commit 796a4a795a

View file

@ -1295,7 +1295,11 @@ namespace MWPhysics
mTimeAccum += dt;
const float physicsDt = 1.f/60.0f;
const int maxAllowedSteps = 20;
int numSteps = mTimeAccum / (physicsDt);
numSteps = std::min(numSteps, maxAllowedSteps);
mTimeAccum -= numSteps * physicsDt;
if (numSteps)