Update of /cvsroot/super-tux/supertux/lib/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4103/lib/gui
Modified Files:
menu.cpp
Log Message:
Empty menus shouldn't lead to crashs anymore.
Index: menu.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/lib/gui/menu.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- menu.cpp 5 Aug 2004 14:09:12 -0000 1.10
+++ menu.cpp 7 Aug 2004 11:34:41 -0000 1.11
@@ -770,7 +770,7 @@
/* 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 @@
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 @@
}
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;
|