From 2ac55fe1293cf5c6b9927c926826da259cf640ea Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Wed, 27 Aug 2014 10:24:55 +0200 Subject: [PATCH] Only refresh menu items that have been created in the JoystickMenu to avoid crash --- src/supertux/menu/joystick_menu.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/supertux/menu/joystick_menu.cpp b/src/supertux/menu/joystick_menu.cpp index c60bd7142..5e47bba90 100644 --- a/src/supertux/menu/joystick_menu.cpp +++ b/src/supertux/menu/joystick_menu.cpp @@ -224,7 +224,13 @@ JoystickMenu::refresh() refresh_menu_item(Controller::PEEK_RIGHT); refresh_menu_item(Controller::PEEK_UP); refresh_menu_item(Controller::PEEK_DOWN); - refresh_menu_item(Controller::CHEAT_MENU); + + if (g_config->developer_mode || g_config->console_enabled) { + refresh_menu_item(Controller::CONSOLE); + } + if (g_config->developer_mode) { + refresh_menu_item(Controller::CHEAT_MENU); + } } } -- 2.11.0