forked from teamnwah/openmw-tes3coop
Avoid the 'spiral of death'
This commit is contained in:
parent
383524c688
commit
796a4a795a
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue