aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorx3Karma <juliuslimck@gmail.com>2023-12-01 08:14:41 +0800
committerGitHub <noreply@github.com>2023-12-01 01:14:41 +0100
commitbdb73b1fd5ddd1899adae528ec64b3077b918a61 (patch)
tree3bf010ae58bd4ea7f976e43f291f96db22b4e77b
parent4e394ce4f7cdf18a4acea8db6ff85fc6f858d45e (diff)
downloadNorthstarMods-1.20.3.tar.gz
NorthstarMods-1.20.3.zip
Fix crash when calling for invalid loadout index (#764)v1.20.3v1.20.2-rc1v1.20.2
Requesting for invalid loadout index using SwapSecondaryAndWeapon3PersistentLoadoutData will cause a crash. This change just adds a check to reset the loadout index.
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut4
1 files changed, 4 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut
index 76cb4ac4..63756fdc 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut
@@ -193,6 +193,10 @@ bool function ClientCommandCallback_SwapSecondaryAndWeapon3PersistentLoadoutData
// get loadout
int index = args[0].tointeger()
+
+ if ( !IsValidPilotLoadoutIndex(index) )
+ return false
+
PilotLoadoutDef loadout = GetPilotLoadoutFromPersistentData( player, index )
// swap loadouts