From 13abc82763d7ec15be0b7188a07d6ad35ebc60b9 Mon Sep 17 00:00:00 2001 From: DevKage <33748002+ufrshubham@users.noreply.github.com> Date: Sat, 11 Nov 2023 14:40:02 +0530 Subject: [PATCH] Pop all states on `Closed` event --- src/GameOver.cpp | 2 +- src/GamePlay.cpp | 2 +- src/MainMenu.cpp | 2 +- src/PauseGame.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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) {