From 8093970d54ab3cf3516fce99850d6506235946af Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Sat, 16 Aug 2014 03:12:22 +0200 Subject: [PATCH] Prevent menu calls while another menu is active --- src/supertux/game_session.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/supertux/game_session.cpp b/src/supertux/game_session.cpp index 0a5195f7c..b83453da1 100644 --- a/src/supertux/game_session.cpp +++ b/src/supertux/game_session.cpp @@ -242,7 +242,8 @@ void GameSession::toggle_pause() { // pause - if(!game_pause) { + if (!game_pause && !MenuManager::instance().is_active()) + { speed_before_pause = g_screen_manager->get_speed(); g_screen_manager->set_speed(0); MenuManager::instance().set_menu(MenuStorage::GAME_MENU); @@ -423,8 +424,11 @@ GameSession::update(float elapsed_time) if(g_input_manager->get_controller()->pressed(Controller::CHEAT_MENU)) { - game_pause = true; - MenuManager::instance().set_menu(MenuStorage::CHEAT_MENU); + if (!MenuManager::instance().is_active()) + { + game_pause = true; + MenuManager::instance().set_menu(MenuStorage::CHEAT_MENU); + } } process_events(); -- 2.11.0