From c0de294c59d0472ae334e20012ed3d3a71f29f1a Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Thu, 20 Jan 2022 21:47:31 +0400 Subject: [PATCH] MeanZombieStalker Accessed None 'Controller' fix --- sources/Zeds/Mean/MeanZombieStalker.uc | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/sources/Zeds/Mean/MeanZombieStalker.uc b/sources/Zeds/Mean/MeanZombieStalker.uc index f302d94..cb84cd5 100644 --- a/sources/Zeds/Mean/MeanZombieStalker.uc +++ b/sources/Zeds/Mean/MeanZombieStalker.uc @@ -173,25 +173,34 @@ simulated function int AttackAndMoveDoAnimAction( name AnimName ) { } return super.DoAnimAction( AnimName ); } -function bool MeleeDamageTarget(int hitdamage, vector pushdir) { + +function bool MeleeDamageTarget(int hitdamage, vector pushdir) +{ local bool result; local float effectStrenght; local NiceHumanPawn targetPawn; - result = Super(NiceMonster).MeleeDamageTarget(hitdamage, pushdir); - targetPawn = NiceHumanPawn(Controller.Target); - if(result && targetPawn != none){ - if(targetPawn.ShieldStrength > 100) + + result = super(NiceMonster).MeleeDamageTarget(hitdamage, pushdir); + // if true means we checked ctlr and ctrl.target != none + if (result) + targetPawn = NiceHumanPawn(Controller.Target); + + if (result && targetPawn != none) + { + if (targetPawn.ShieldStrength > 100) return result; - else if(targetPawn.ShieldStrength < 0) + else if (targetPawn.ShieldStrength < 0) effectStrenght = 1.0; else effectStrenght = (100 - targetPawn.ShieldStrength) * 0.01; + class'MeanReplicationInfo'.static .findSZri(targetPawn.PlayerReplicationInfo) .setBleeding(Self, effectStrenght); } return result; } + function RemoveHead() { Super(NiceMonster).RemoveHead();