From 6d94cbd61ccf01ac9b2abfdf56a399f77d33dd1b Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Fri, 21 Jan 2022 15:06:44 +0400 Subject: [PATCH] ModHeadDamage accessed none KFPRI fixed --- sources/Zeds/NiceMonster.uc | 42 ++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/sources/Zeds/NiceMonster.uc b/sources/Zeds/NiceMonster.uc index 39b86a6..8e0d068 100644 --- a/sources/Zeds/NiceMonster.uc +++ b/sources/Zeds/NiceMonster.uc @@ -750,6 +750,7 @@ function ModFireDamage( out int damage, if(bFireImmune) damage /= 10; } + function ModHeadDamage( out int damage, Pawn instigatedBy, Vector hitLocation, @@ -757,22 +758,35 @@ function ModHeadDamage( out int damage, class dmgType, float headshotLevel, KFPlayerReplicationInfo KFPRI, - optional float lockonTime){ - local bool shouldCountHS; - local NicePlayerController nicePlayer; - local class niceVet; - if(instigatedBy != none) - nicePlayer = NicePlayerController(instigatedBy.Controller); - shouldCountHS = (lockonTime >= dmgType.default.lockonTime) + optional float lockonTime) +{ + local bool shouldCountHS; + local NicePlayerController nicePlayer; + local class niceVet; + + if (instigatedBy != none) + nicePlayer = NicePlayerController(instigatedBy.Controller); + shouldCountHS = (lockonTime >= dmgType.default.lockonTime) && (headshotLevel > dmgType.default.prReqMultiplier); - // Weapon damage bonus - if(dmgType != none && shouldCountHS) - damage *= dmgType.default.HeadShotDamageMult; - // Perk damage bonus - niceVet = class(KFPRI.ClientVeteranSkill); - if(KFPRI != none && niceVet != none) - damage *= niceVet.static.GetNiceHeadShotDamMulti(KFPRI, self, dmgType); + + // Weapon damage bonus + if (dmgType != none && shouldCountHS) + damage *= dmgType.default.HeadShotDamageMult; + + // Perk damage bonus + if (KFPRI != none) + { + niceVet = class(KFPRI.ClientVeteranSkill); + if (niceVet != none) + damage *= niceVet.static.GetNiceHeadShotDamMulti(KFPRI, self, dmgType); + } + + + + + } + // This function must record damage actual value in 'damage' variable and // return value that will decide stun/flinch function int ModBodyDamage( out int damage,