X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=lib%2Fgui%2Fmenu.cpp;h=d35f6d902244c49804c83ef6f441e3617081b6ff;hb=9ea50023ee514dfd2ba0cdb53cef91d6b842bafc;hp=28e6efff769a7199a7f73194d2c60967430570a4;hpb=b46d315e072211b91cd14a6208515ffed10d4392;p=supertux.git diff --git a/lib/gui/menu.cpp b/lib/gui/menu.cpp index 28e6efff7..d35f6d902 100644 --- a/lib/gui/menu.cpp +++ b/lib/gui/menu.cpp @@ -770,7 +770,7 @@ Menu::event(SDL_Event& event) /* An International Character. */ } - if(item[active_item].kind == MN_CONTROLFIELD_KB) + if(item.size() > 0 && item[active_item].kind == MN_CONTROLFIELD_KB) { if(key == SDLK_ESCAPE) { @@ -798,7 +798,7 @@ Menu::event(SDL_Event& event) menuaction = MENU_ACTION_RIGHT; break; case SDLK_SPACE: - if(item[active_item].kind == MN_TEXTFIELD) + if(item.size() > 0 && item[active_item].kind == MN_TEXTFIELD) { menuaction = MENU_ACTION_INPUT; mn_input_char = ' '; @@ -848,7 +848,7 @@ Menu::event(SDL_Event& event) } break; case SDL_JOYBUTTONDOWN: - if (item[active_item].kind == MN_CONTROLFIELD_JS) + if (item.size() > 0 && item[active_item].kind == MN_CONTROLFIELD_JS) { // FIXME: This next line does nothing useable, right? // *item[active_item].int_p = key;