MeanZombieStalker Accessed None 'Controller' fix

This commit is contained in:
Shtoyan 2022-01-20 21:47:31 +04:00
parent 410515b99d
commit c0de294c59

View File

@ -173,25 +173,34 @@ simulated function int AttackAndMoveDoAnimAction( name AnimName ) {
} }
return super.DoAnimAction( AnimName ); return super.DoAnimAction( AnimName );
} }
function bool MeleeDamageTarget(int hitdamage, vector pushdir) {
function bool MeleeDamageTarget(int hitdamage, vector pushdir)
{
local bool result; local bool result;
local float effectStrenght; local float effectStrenght;
local NiceHumanPawn targetPawn; local NiceHumanPawn targetPawn;
result = Super(NiceMonster).MeleeDamageTarget(hitdamage, pushdir);
result = super(NiceMonster).MeleeDamageTarget(hitdamage, pushdir);
// if true means we checked ctlr and ctrl.target != none
if (result)
targetPawn = NiceHumanPawn(Controller.Target); targetPawn = NiceHumanPawn(Controller.Target);
if(result && targetPawn != none){
if(targetPawn.ShieldStrength > 100) if (result && targetPawn != none)
{
if (targetPawn.ShieldStrength > 100)
return result; return result;
else if(targetPawn.ShieldStrength < 0) else if (targetPawn.ShieldStrength < 0)
effectStrenght = 1.0; effectStrenght = 1.0;
else else
effectStrenght = (100 - targetPawn.ShieldStrength) * 0.01; effectStrenght = (100 - targetPawn.ShieldStrength) * 0.01;
class'MeanReplicationInfo'.static class'MeanReplicationInfo'.static
.findSZri(targetPawn.PlayerReplicationInfo) .findSZri(targetPawn.PlayerReplicationInfo)
.setBleeding(Self, effectStrenght); .setBleeding(Self, effectStrenght);
} }
return result; return result;
} }
function RemoveHead() function RemoveHead()
{ {
Super(NiceMonster).RemoveHead(); Super(NiceMonster).RemoveHead();