1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-06 02:15:32 +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)