Menu: Fix a crash when we've got no entries or are out of bounds

This commit is contained in:
Marco Cawthorne 2020-03-26 07:04:32 +01:00
parent 520e91616a
commit cdb1bbddfd
2 changed files with 3 additions and 2 deletions

View File

@ -133,7 +133,6 @@ void inet_lb_changed(int val)
inet_lbServers_Map.SetScroll(val);
inet_lbServers_Game.SetScroll(val);
inet_lbServers_Players.SetScroll(val);
inet_lbServers_Addresses.SetScroll(val);
}
void menu_internetgames_init(void)

View File

@ -119,7 +119,9 @@ void CListBox::SetSize(int w, int h)
void CListBox::SetScroll(int i)
{
m_scroll = i;
if (i >= 0 && i < LB_MAX_ENTRIES) {
m_scroll = i;
}
}
void CListBox::SetChanged(void(int val) func)