From 40c57e8115110a7014160ad06f735c92a58c9169 Mon Sep 17 00:00:00 2001 From: Benau Date: Tue, 25 Feb 2020 09:55:59 +0800 Subject: [PATCH] Don't check dialog for enterGameState in no graphics STK --- src/guiengine/abstract_state_manager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/guiengine/abstract_state_manager.cpp b/src/guiengine/abstract_state_manager.cpp index b7e495864..3cf77ea5d 100644 --- a/src/guiengine/abstract_state_manager.cpp +++ b/src/guiengine/abstract_state_manager.cpp @@ -49,16 +49,17 @@ AbstractStateManager::AbstractStateManager() void AbstractStateManager::enterGameState() { - // you need to close any dialog before calling this - assert(!ModalDialog::isADialogActive()); - assert(!ScreenKeyboard::isActive()); - if (GUIEngine::isNoGraphics()) { + // No graphics STK won't push dialog setGameState(GAME); return; } + // you need to close any dialog before calling this + assert(!ModalDialog::isADialogActive()); + assert(!ScreenKeyboard::isActive()); + if (getCurrentScreen() != NULL) getCurrentScreen()->tearDown(); m_menu_stack.clear(); m_menu_stack.emplace_back(RACE_STATE_NAME, (Screen*)NULL);