Skip to content

Commit

Permalink
Fixed crash when calling for invalid loadout index
Browse files Browse the repository at this point in the history
  • Loading branch information
x3Karma authored Nov 30, 2023
1 parent 4e394ce commit 9e65b6c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ bool function ClientCommandCallback_SwapSecondaryAndWeapon3PersistentLoadoutData

// get loadout
int index = args[0].tointeger()

if ( !IsValidPilotLoadoutIndex(index) )
index = 0

PilotLoadoutDef loadout = GetPilotLoadoutFromPersistentData( player, index )

// swap loadouts
Expand Down

0 comments on commit 9e65b6c

Please sign in to comment.