Merge pull request #2 from x3Karma/patch-1

Fix crash when offhand is empty
This commit is contained in:
Legonzaur
2022-03-01 11:45:49 +01:00
committed by GitHub
+1 -1
View File
@@ -25,7 +25,7 @@ int recharge_remove = 1
{ {
if ( IsValid(player) && IsAlive( player )) if ( IsValid(player) && IsAlive( player ))
{ {
if(player.GetOffhandWeapon(1).GetWeaponClassName() == "mp_ability_holopilot"){ if( IsValid(player.GetOffhandWeapon(1)) && player.GetOffhandWeapon(1).GetWeaponClassName() == "mp_ability_holopilot"){
Assert(player) Assert(player)
if(!player.IsPhaseShifted()){ if(!player.IsPhaseShifted()){
int chargeCount = player.GetOffhandWeapon(1).GetWeaponPrimaryClipCount() int chargeCount = player.GetOffhandWeapon(1).GetWeaponPrimaryClipCount()