From 316ec34133f264dc7d5bfc7a0a3eb0f622f83bed Mon Sep 17 00:00:00 2001 From: NachosChipeados <103285866+NachosChipeados@users.noreply.github.com> Date: Mon, 18 Nov 2024 09:19:20 -0400 Subject: [PATCH] Fix UI error when leaving the lobby too quickly (#887) Adds a validity check for UIPlayer identity before fetching persistent spawn loadout index --- .../mod/scripts/vscripts/sh_progression.nut | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index 3297643ec..307548d7b 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -169,8 +169,13 @@ void function UpdateCachedLoadouts_Threaded() // below here is just making all the menu models update properly and such #if UI - uiGlobal.pilotSpawnLoadoutIndex = GetPersistentSpawnLoadoutIndex( GetUIPlayer(), "pilot" ) - uiGlobal.titanSpawnLoadoutIndex = GetPersistentSpawnLoadoutIndex( GetUIPlayer(), "titan" ) + entity UIPlayer = GetUIPlayer() + + if ( !IsValid( UIPlayer ) ) + return + + uiGlobal.pilotSpawnLoadoutIndex = GetPersistentSpawnLoadoutIndex( UIPlayer, "pilot" ) + uiGlobal.titanSpawnLoadoutIndex = GetPersistentSpawnLoadoutIndex( UIPlayer, "titan" ) #endif #if CLIENT