]> git.localhorst.tv Git - l2e.git/blobdiff - src/app/Application.cpp
break out of physics loop if a state change happened
[l2e.git] / 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);
        }