From 9b3250e4995df6a0540fb1bc65be950f4ee1351f Mon Sep 17 00:00:00 2001 From: x3Karma Date: Tue, 1 Mar 2022 13:36:32 +0800 Subject: [PATCH] Fix crash when offhand is empty --- mod/scripts/vscripts/holoshift_recharge.gnut | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/scripts/vscripts/holoshift_recharge.gnut b/mod/scripts/vscripts/holoshift_recharge.gnut index dae43b4..8f9a65d 100644 --- a/mod/scripts/vscripts/holoshift_recharge.gnut +++ b/mod/scripts/vscripts/holoshift_recharge.gnut @@ -25,7 +25,7 @@ int recharge_remove = 1 { 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) if(!player.IsPhaseShifted()){ int chargeCount = player.GetOffhandWeapon(1).GetWeaponPrimaryClipCount() @@ -58,4 +58,4 @@ int recharge_remove = 1 } -#endif \ No newline at end of file +#endif