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
1 changed files with 6 additions and 3 deletions

View File

@ -244,12 +244,15 @@ bi_Menu_SelectMenu (progs_t *pr)
{
const char *name = G_STRING (pr, OFS_PARM0);
menu = Hash_Find (menu_hash, name);
menu = 0;
if (name && *name)
menu = Hash_Find (menu_hash, name);
if (menu) {
key_dest = key_menu;
game_target = IMT_CONSOLE;
} else {
Con_Printf ("no menu \"%s\"\n", name);
if (name && *name)
Con_Printf ("no menu \"%s\"\n", name);
if (con_data.force_commandline) {
key_dest = key_console;
game_target = IMT_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: