Compare commits

...

2 Commits

Author SHA1 Message Date
Shtoyan
7f224e1288 a 2022-01-21 15:07:17 +04:00
Shtoyan
6d94cbd61c ModHeadDamage accessed none KFPRI fixed 2022-01-21 15:06:44 +04:00

View File

@ -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,30 @@ function ModHeadDamage( out int damage,
class<NiceWeaponDamageType> dmgType,
float headshotLevel,
KFPlayerReplicationInfo KFPRI,
optional float lockonTime){
optional float lockonTime)
{
local bool shouldCountHS;
local NicePlayerController nicePlayer;
local class<NiceVeterancyTypes> 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
if (KFPRI != none)
{
niceVet = class<NiceVeterancyTypes>(KFPRI.ClientVeteranSkill);
if(KFPRI != none && niceVet != none)
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,