diff --git a/src/GameOver.cpp b/src/GameOver.cpp index 8fefcec..05e4e46 100644 --- a/src/GameOver.cpp +++ b/src/GameOver.cpp @@ -50,7 +50,7 @@ void GameOver::ProcessInput() { if (event.type == sf::Event::Closed) { - m_context->m_window->close(); + m_context->m_states->PopAll(); } else if (event.type == sf::Event::KeyPressed) { diff --git a/src/GamePlay.cpp b/src/GamePlay.cpp index a80bf97..140d579 100644 --- a/src/GamePlay.cpp +++ b/src/GamePlay.cpp @@ -65,7 +65,7 @@ void GamePlay::ProcessInput() { if (event.type == sf::Event::Closed) { - m_context->m_window->close(); + m_context->m_states->PopAll(); } else if (event.type == sf::Event::KeyPressed) { diff --git a/src/MainMenu.cpp b/src/MainMenu.cpp index da29d62..5441a53 100644 --- a/src/MainMenu.cpp +++ b/src/MainMenu.cpp @@ -51,7 +51,7 @@ void MainMenu::ProcessInput() { if (event.type == sf::Event::Closed) { - m_context->m_window->close(); + m_context->m_states->PopAll(); } else if (event.type == sf::Event::KeyPressed) { diff --git a/src/PauseGame.cpp b/src/PauseGame.cpp index 310e234..2ea0c37 100644 --- a/src/PauseGame.cpp +++ b/src/PauseGame.cpp @@ -29,7 +29,7 @@ void PauseGame::ProcessInput() { if (event.type == sf::Event::Closed) { - m_context->m_window->close(); + m_context->m_states->PopAll(); } else if (event.type == sf::Event::KeyPressed) {