From e4faa247edaf389d4d52e3a3129af540bb19a0ac Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sat, 25 Dec 2021 04:51:27 +0000 Subject: fix server browser showing n-1 servers --- Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Northstar.Client/mod') diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut index 97072ab5..03009764 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut @@ -135,7 +135,10 @@ void function UpdateShownPage() return } - for ( int i = 0; ( file.page * BUTTONS_PER_PAGE ) + i < NSGetServerCount() - 1 && i < serverButtons.len(); i++ ) + // this trycatch likely isn't necessary, but i can't test whether this'll error on higher pagecounts and want to go sleep + try + { + for ( int i = 0; ( file.page * BUTTONS_PER_PAGE ) + i < NSGetServerCount() && i < serverButtons.len(); i++ ) { int serverIndex = ( file.page * BUTTONS_PER_PAGE ) + i @@ -143,6 +146,8 @@ void function UpdateShownPage() Hud_SetVisible( serverButtons[ i ], true ) SetButtonRuiText( serverButtons[ i ], NSGetServerName( serverIndex ) ) } + } + catch(ex) {} } void function OnServerFocused( var button ) -- cgit v1.2.3