Fix crash when offhand is empty

This commit is contained in:
x3Karma
2022-03-01 13:36:32 +08:00
committed by GitHub
parent 2fddd8e732
commit 9b3250e499
+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()