aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorF1F7Y <that.fifty@gmail.com>2021-12-30 18:38:16 +0100
committerF1F7Y <that.fifty@gmail.com>2021-12-30 18:38:16 +0100
commit3393142c717b4f450fda77e5a1f11b2573590cd5 (patch)
tree1fb7bd8f67859a93ccdaf9ca676137778eecfbc2
parent8d833a79b4f103abf3394bf1c9bebc071e1f84bd (diff)
downloadNorthstarMods-3393142c717b4f450fda77e5a1f11b2573590cd5.tar.gz
NorthstarMods-3393142c717b4f450fda77e5a1f11b2573590cd5.zip
Fix out of range array access; add server count
-rw-r--r--Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut5
1 files changed, 5 insertions, 0 deletions
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 )