From 9d5fba534463c9ab11cf08bd21c253e9cdb9e030 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Thu, 20 Jan 2022 22:07:02 +0400 Subject: [PATCH] ClawDamageSingleTarget accessed none ctrl fix --- sources/Zeds/Nice/NiceZombieBrute.uc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sources/Zeds/Nice/NiceZombieBrute.uc b/sources/Zeds/Nice/NiceZombieBrute.uc index ddbae1c..6d5984b 100644 --- a/sources/Zeds/Nice/NiceZombieBrute.uc +++ b/sources/Zeds/Nice/NiceZombieBrute.uc @@ -232,6 +232,7 @@ function ClawDamageTarget() PlaySound(MeleeAttackHitSound, SLOT_Interact, 1.25); } } + function bool ClawDamageSingleTarget(float UsedMeleeDamage, Actor ThisTarget) { local Pawn HumanTarget; @@ -239,6 +240,11 @@ function bool ClawDamageSingleTarget(float UsedMeleeDamage, Actor ThisTarget) local bool bHitSomeone; local float EnemyAngle; local vector PushForceVar; + + // fix log spam + if (Controller == none || ThisTarget == none) + return false; + EnemyAngle = Normal(ThisTarget.Location - Location) dot vector(Rotation); if (EnemyAngle > 0) { @@ -272,6 +278,7 @@ function bool ClawDamageSingleTarget(float UsedMeleeDamage, Actor ThisTarget) } return bHitSomeone; } + function StartCharging() { // How many times should we hit before we cool down?