Skip to content

Commit

Permalink
Prevent menu calls while another menu is active
Browse files Browse the repository at this point in the history
  • Loading branch information
Grumbel committed Aug 16, 2014
1 parent bcc4442 commit 8093970
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/supertux/game_session.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 8093970

Please sign in to comment.