]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/states/RunState.cpp
store an application handle in each state
[l2e.git] / src / battle / states / RunState.cpp
index dbf38680d55671ab69ba6057e5bc23eaab0e0398..cf113f24f5a41b6aa433191f64365b14b4176f1e 100644 (file)
@@ -23,11 +23,11 @@ using geometry::Vector;
 namespace battle {
 
 void RunState::OnEnterState(Application &c, SDL_Surface *screen) {
-       ctrl = &c;
+
 }
 
 void RunState::OnExitState(Application &c, SDL_Surface *screen) {
-       ctrl = 0;
+
 }
 
 void RunState::OnResumeState(Application &ctrl, SDL_Surface *screen) {
@@ -47,7 +47,7 @@ void RunState::OnResize(int width, int height) {
 void RunState::HandleEvents(const Input &input) {
        if (timer.Finished()) {
                battle->SetRunaway();
-               ctrl->PopState(); // pop self
+               Ctrl().PopState(); // pop self
        }
 }