don't seg on menus with no items

This commit is contained in:
Bill Currie 2002-01-21 21:38:34 +00:00
parent 3ae15803fa
commit 5450fdb692

View file

@ -392,7 +392,6 @@ Menu_Draw (void)
return; return;
} }
item = menu->items[menu->cur_item];
for (m_pic = menu->pics; m_pic; m_pic = m_pic->next) { for (m_pic = menu->pics; m_pic; m_pic = m_pic->next) {
qpic_t *pic = Draw_CachePic (m_pic->name, 1); qpic_t *pic = Draw_CachePic (m_pic->name, 1);
@ -406,6 +405,9 @@ Menu_Draw (void)
menu->items[i]->text); menu->items[i]->text);
} }
} }
if (!menu->items)
return;
item = menu->items[menu->cur_item];
if (menu->cursor) { if (menu->cursor) {
G_INT (&menu_pr_state, OFS_PARM0) = item->x; G_INT (&menu_pr_state, OFS_PARM0) = item->x;
G_INT (&menu_pr_state, OFS_PARM1) = item->y; G_INT (&menu_pr_state, OFS_PARM1) = item->y;