From: Daniel Karbach Date: Sun, 7 Oct 2012 14:15:15 +0000 (+0200) Subject: break out of physics loop if a state change happened X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;h=11f21c99f562231785660da3afc4d0590ad83e90;p=l2e.git break out of physics loop if a state change happened --- 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); }