From 11f21c99f562231785660da3afc4d0590ad83e90 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Sun, 7 Oct 2012 16:15:15 +0200 Subject: [PATCH] break out of physics loop if a state change happened --- src/app/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/Application.cpp b/src/app/Application.cpp index 4c8c574..4ff75d8 100644 --- a/src/app/Application.cpp +++ b/src/app/Application.cpp @@ -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); } -- 2.39.2