From b9c4c9cbbbda5f075b42f45ef50e6f86fb3197fd Mon Sep 17 00:00:00 2001 From: NachosChipeados <103285866+NachosChipeados@users.noreply.github.com> Date: Wed, 2 Oct 2024 08:42:22 -0400 Subject: [PATCH 1/5] Update sh_loadouts.nut --- Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut index 7a7498b8c..5dc761d08 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut @@ -2812,6 +2812,9 @@ string function GetParentLoadoutProperty( string loadoutType, string propertyNam int function GetPersistentSpawnLoadoutIndex( entity player, string loadoutType ) { + if (!IsValid ( player ) ) + return -1 + int loadoutIndex = player.GetPersistentVarAsInt( loadoutType + "SpawnLoadout.index" ) if ( loadoutType == "titan" && loadoutIndex >= NUM_PERSISTENT_TITAN_LOADOUTS ) loadoutIndex = 0 From 4d868969c7b036b5bb8121514408ae5424fbbfba Mon Sep 17 00:00:00 2001 From: NachosChipeados <103285866+NachosChipeados@users.noreply.github.com> Date: Sat, 12 Oct 2024 23:06:46 -0400 Subject: [PATCH 2/5] Update sh_progression.nut --- .../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..73ec273f3 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 From 5b599f4261992181c739286066976a8697137f90 Mon Sep 17 00:00:00 2001 From: NachosChipeados <103285866+NachosChipeados@users.noreply.github.com> Date: Sat, 16 Nov 2024 09:42:43 -0400 Subject: [PATCH 3/5] Add space --- Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index 73ec273f3..86c4c3d1b 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -171,7 +171,7 @@ void function UpdateCachedLoadouts_Threaded() #if UI entity UIPlayer = GetUIPlayer() - if (!IsValid ( UIPlayer ) ) + if ( !IsValid ( UIPlayer ) ) return uiGlobal.pilotSpawnLoadoutIndex = GetPersistentSpawnLoadoutIndex( UIPlayer, "pilot" ) From 7da554dd90b4545a4d9aafdf6a0a1165a3b5cba8 Mon Sep 17 00:00:00 2001 From: NachosChipeados Date: Sat, 16 Nov 2024 09:46:04 -0400 Subject: [PATCH 4/5] Revert "Update sh_loadouts.nut" This reverts commit b9c4c9cbbbda5f075b42f45ef50e6f86fb3197fd. --- Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut | 3 --- 1 file changed, 3 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut index ce07cd44e..4bf195b6d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_loadouts.nut @@ -2813,9 +2813,6 @@ string function GetParentLoadoutProperty( string loadoutType, string propertyNam int function GetPersistentSpawnLoadoutIndex( entity player, string loadoutType ) { - if (!IsValid ( player ) ) - return -1 - int loadoutIndex = player.GetPersistentVarAsInt( loadoutType + "SpawnLoadout.index" ) if ( loadoutType == "titan" && loadoutIndex >= NUM_PERSISTENT_TITAN_LOADOUTS ) loadoutIndex = 0 From 6d41fc9ff2900b00e64571ed9ae4baa9c1ebe407 Mon Sep 17 00:00:00 2001 From: NachosChipeados <103285866+NachosChipeados@users.noreply.github.com> Date: Sat, 16 Nov 2024 09:48:33 -0400 Subject: [PATCH 5/5] Remove other space --- Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index 86c4c3d1b..307548d7b 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -171,7 +171,7 @@ void function UpdateCachedLoadouts_Threaded() #if UI entity UIPlayer = GetUIPlayer() - if ( !IsValid ( UIPlayer ) ) + if ( !IsValid( UIPlayer ) ) return uiGlobal.pilotSpawnLoadoutIndex = GetPersistentSpawnLoadoutIndex( UIPlayer, "pilot" )