From: Ingo Ruhnke Date: Sat, 16 Aug 2014 01:12:22 +0000 (+0200) Subject: Prevent menu calls while another menu is active X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8093970d54ab3cf3516fce99850d6506235946af;p=supertux.git Prevent menu calls while another menu is active --- 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();