Menu: Fix a crash when we've got no entries or are out of bounds
This commit is contained in:
parent
520e91616a
commit
cdb1bbddfd
|
@ -133,7 +133,6 @@ void inet_lb_changed(int val)
|
||||||
inet_lbServers_Map.SetScroll(val);
|
inet_lbServers_Map.SetScroll(val);
|
||||||
inet_lbServers_Game.SetScroll(val);
|
inet_lbServers_Game.SetScroll(val);
|
||||||
inet_lbServers_Players.SetScroll(val);
|
inet_lbServers_Players.SetScroll(val);
|
||||||
inet_lbServers_Addresses.SetScroll(val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_internetgames_init(void)
|
void menu_internetgames_init(void)
|
||||||
|
|
|
@ -119,7 +119,9 @@ void CListBox::SetSize(int w, int h)
|
||||||
|
|
||||||
void CListBox::SetScroll(int i)
|
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)
|
void CListBox::SetChanged(void(int val) func)
|
||||||
|
|
Loading…
Reference in New Issue