diff --git a/src/saland/GameSpellState.cpp b/src/saland/GameSpellState.cpp index c737710..1a31542 100644 --- a/src/saland/GameSpellState.cpp +++ b/src/saland/GameSpellState.cpp @@ -90,16 +90,16 @@ bool GameSpellState::IsSpellSelectActive() { } void GameSpellState::ProcessInput(const SDL_Event& event, bool& processed) { + UpdateMouseCoordinates(event, globalData.mousex, globalData.mousey); + if (event.type == SDL_KEYDOWN) { + if (event.key.keysym.sym == SDLK_ESCAPE) { + data->spellSelectActive = !data->spellSelectActive; + processed = true; + } + } if (!data->spellSelectActive) { return; - } - UpdateMouseCoordinates(event, globalData.mousex, globalData.mousey); - if (event.type == SDL_KEYDOWN) { - if (event.key.keysym.sym == SDLK_ESCAPE) { - data->spellSelectActive = !data->spellSelectActive; - processed = true; - } - } + } if (event.type == SDL_MOUSEBUTTONDOWN) { if (event.button.button == SDL_BUTTON_LEFT) { std::cout << "Left click " << globalData.mousex << "," << globalData.mousey << "\n"; @@ -120,4 +120,4 @@ void GameSpellState::ProcessInput(const SDL_Event& event, bool& processed) { void GameSpellState::Update() {}; GameSpellState::~GameSpellState() { -} \ No newline at end of file +}