]> git.localhorst.tv Git - l2e.git/blobdiff - src/app/Application.cpp
fix bug in Application that caused the program to crash just before it finished
[l2e.git] / src / app / Application.cpp
index fc1d3801d4ab6fe65f0ea8af622904e0eb01b194..c1e4f15311526ec5f767078d5faf30d5d9a72eb5 100644 (file)
@@ -28,7 +28,7 @@ Application::~Application() {
 
 
 State *Application::CurrentState() {
-       return states.top();
+       return states.empty() ? 0 : states.top();
 }
 
 void Application::UpdateState() {
@@ -159,7 +159,7 @@ void Application::HandleEvents() {
                                break;
                }
        }
-       CurrentState()->HandleInput(input);
+       CurrentState()->HandleEvents(input);
 }
 
 void Application::UpdateWorld(Uint32 deltaT) {