another attempt to fix accessed none killer

This commit is contained in:
Shtoyan 2022-01-20 23:51:49 +04:00
parent 692b66b9a6
commit 0f987e9a1e

View File

@ -546,9 +546,10 @@ simulated function BleedOutTick(float deltaTick)
return;
if (LastDamagedBy != none)
Died(LastDamagedBy.Controller, class'DamTypeBleedOut', Location);
// else we can say we killed ourselves, none -> self
// else we can say we killed ourselves, none -> controller (self)
// P.S. we really need to use Suicide here D:
else
Died(self, class'DamTypeBleedOut', Location);
Died(controller, class'DamTypeBleedOut', Location);
BleedOutTime = 0;
}
@ -1083,19 +1084,27 @@ function DealBodyDamage(int damage,
damageType, headshotLevel);
MakeNoise(1.0);
}
function Died( Controller killer,
class<DamageType> damageType,
vector HitLocation){
vector HitLocation)
{
local bool bHasManiac;
local NiceHumanPawn nicePawn;
if (killer != none || (Controller != none && killer != Controller))
{
bHasManiac = class'NiceVeterancyTypes'.static.
HasSkill(NicePlayerController(killer), class'NiceSkillDemoManiac');
nicePawn = NiceHumanPawn(killer.pawn);
if (bHasManiac && nicePawn != none)
nicePawn.maniacTimeout =
class'NiceSkillDemoManiac'.default.reloadBoostTime;
}
super.Died(killer, damageType, HitLocation);
}
simulated function SetTearOffMomemtum(vector NewMomentum){
TearOffMomentum = NewMomentum;
TearOffMomentumX = NewMomentum.X;