From 3393142c717b4f450fda77e5a1f11b2573590cd5 Mon Sep 17 00:00:00 2001 From: F1F7Y Date: Thu, 30 Dec 2021 18:38:16 +0100 Subject: Fix out of range array access; add server count --- Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut | 5 +++++ 1 file changed, 5 insertions(+) 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 dd2f8864..15622a2f 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut @@ -742,6 +742,7 @@ void function FilterServerList() printt("---------------------------------------------") Hud_SetText( Hud_GetChild( file.menu, "InGamePlayerCount" ), string( totalPlayers ) ) + Hud_SetText( Hud_GetChild( file.menu, "TotalServerCount" ), string( NSGetServerCount() ) ) } void function CheckGamemode( serverStruct t ) @@ -817,6 +818,9 @@ void function OnServerButtonClicked(var button) void function CheckDoubleClick(int scriptID, bool wasClickNav) { + if ( NSGetServerCount() == 0 ) return + + file.focusedServerIndex = file.serversArrayFiltered[ file.scrollOffset + scriptID ].serverIndex int serverIndex = file.scrollOffset + scriptID @@ -848,6 +852,7 @@ void function DisplayFocusedServerInfo( int scriptID) var menu = GetMenu( "ServerBrowserMenu" ) int serverIndex = file.scrollOffset + scriptID + if (serverIndex < 0) serverIndex = 0 Hud_SetVisible( Hud_GetChild( menu, "BtnServerDescription" ), true ) -- cgit v1.2.3