Only refresh menu items that have been created in the JoystickMenu to avoid crash
authorIngo Ruhnke <grumbel@gmail.com>
Wed, 27 Aug 2014 08:24:55 +0000 (10:24 +0200)
committerIngo Ruhnke <grumbel@gmail.com>
Wed, 27 Aug 2014 08:24:55 +0000 (10:24 +0200)
src/supertux/menu/joystick_menu.cpp

index c60bd71..5e47bba 100644 (file)
@@ -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);
+    }
   }
 }