diff --git a/isometric-park-fna/Simulation.cs b/isometric-park-fna/Simulation.cs --- a/isometric-park-fna/Simulation.cs +++ b/isometric-park-fna/Simulation.cs @@ -441,6 +441,11 @@ int advancesToSimulate = (int)((this.Elapsed - this.lastAdvance) / millisecondsPerAdvance); + if (this.lastAdvance > this.Elapsed) + { + Logging.Error(String.Format("Last Advance is ahead of Elapsed by {0} ms. This should basically never happen.", (this.lastAdvance - this.Elapsed))); + } + for (int i = 0; i < advancesToSimulate; i++) { this.advanceSimulation(); @@ -452,8 +457,8 @@ //it's t=125, we have 2.5 steps to simulate. However, we only want to simulate //whole steps for simplicity's sake, so that means we'll simulate 2. But that means we've only simulated //through t=120, so that's what we want to track in lastAdvance. + } this.lastAdvance += advancesToSimulate * millisecondsPerAdvance; - } } } }