- visible = (int)((menu_height - 16 - y) / 8 / 2);
- start = bound(0, slist_cursor - (visible >> 1), serverlist_viewcount - visible);
- end = min(start + visible, serverlist_viewcount);
+ slist_visible = (menu_height - 16 - y) / 8 / 2;
+ start = min(slist_cursor - min(slist_cursor, slist_visible >> 1), serverlist_viewcount - min(serverlist_viewcount, slist_visible));
+ end = min(start + slist_visible, serverlist_viewcount);