]> git.localhorst.tv Git - l2e.git/commitdiff
break out of physics loop if a state change happened
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 7 Oct 2012 14:15:15 +0000 (16:15 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 7 Oct 2012 14:15:15 +0000 (16:15 +0200)
src/app/Application.cpp

index 4c8c5747ff71dd5620fe2a6d26c96fdf0efc4e03..4ff75d8ed10c1104f9abf38142b4ffe46c9d3a5a 100644 (file)
@@ -167,7 +167,7 @@ void Application::HandleEvents() {
 
 void Application::UpdateWorld(Uint32 deltaT) {
        if (!CurrentState()) return;
-       for (Uint32 i(0); i < deltaT; ++i) {
+       for (Uint32 i(0); i < deltaT && !StateChangePending(); ++i) {
                CurrentState()->PhysicsTimers().Update(0.001f);
                CurrentState()->UpdateWorld(0.001f);
        }