make Menu_SelectMenu(NIL) do the right thing and handle qc code that clears

the current menu but forgets to return 1 in keyevent
This commit is contained in:
Bill Currie 2002-01-21 19:40:45 +00:00
parent 7775dab7bb
commit ec0b3d8940

View file

@ -244,11 +244,14 @@ bi_Menu_SelectMenu (progs_t *pr)
{
const char *name = G_STRING (pr, OFS_PARM0);
menu = 0;
if (name && *name)
menu = Hash_Find (menu_hash, name);
if (menu) {
key_dest = key_menu;
game_target = IMT_CONSOLE;
} else {
if (name && *name)
Con_Printf ("no menu \"%s\"\n", name);
if (con_data.force_commandline) {
key_dest = key_console;
@ -426,7 +429,7 @@ Menu_KeyEvent (knum_t key, short unicode, qboolean down)
if (G_INT (&menu_pr_state, OFS_RETURN))
return;
}
if (!menu->items)
if (!menu || !menu->items)
return;
switch (key) {
case QFK_DOWN: