GetDecapDamageModifier KFPRI accessed none fix

This commit is contained in:
Shtoyan 2022-01-21 23:13:47 +04:00
parent 4325a34acf
commit c2fa773fae

View File

@ -899,42 +899,46 @@ function BileDamageEffect( int damage,
NextBileTime = Level.TimeSeconds + BileFrequency;
}
}
function float GetDecapDamageModifier( class<NiceWeaponDamageType> damageType,
NicePlayerController nicePlayer,
KFPlayerReplicationInfo KFPRI){
local float damageMod;
local bool shouldDoGoodDecap;
local bool hasTrashCleaner;
local bool isPerkedPickup;
local class<NiceWeaponPickup> pickupClass;
local class<NiceVeterancyTypes> niceVet;
niceVet = class<NiceVeterancyTypes>(KFPRI.ClientVeteranSkill);
isPerkedPickup = false;
if(niceVet != none){
pickupClass = niceVet.static.GetPickupFromDamageType(damageType);
if(pickupClass != none)
isPerkedPickup = niceVet.static.IsPerkedPickup(pickupClass);
}
shouldDoGoodDecap = false;
shouldDoGoodDecap = (damageType.default.decapType == DB_DROP);
shouldDoGoodDecap = shouldDoGoodDecap ||
KFPlayerReplicationInfo KFPRI)
{
local float damageMod;
local bool shouldDoGoodDecap;
local bool hasTrashCleaner;
local bool isPerkedPickup;
local class<NiceWeaponPickup> pickupClass;
local class<NiceVeterancyTypes> niceVet;
// KFPRI accessed none fix
if (KFPRI != none)
niceVet = class<NiceVeterancyTypes>(KFPRI.ClientVeteranSkill);
isPerkedPickup = false;
if (niceVet != none)
{
pickupClass = niceVet.static.GetPickupFromDamageType(damageType);
if (pickupClass != none)
isPerkedPickup = niceVet.static.IsPerkedPickup(pickupClass);
}
shouldDoGoodDecap = false;
shouldDoGoodDecap = (damageType.default.decapType == DB_DROP);
shouldDoGoodDecap = shouldDoGoodDecap ||
(damageType.default.decapType == DB_PERKED && isPerkedPickup);
if(shouldDoGoodDecap)
damageMod = damageType.default.goodDecapMod;
else
damageMod = damageType.default.badDecapMod;
if(nicePlayer != none)
hasTrashCleaner = class'NiceVeterancyTypes'.static.
if (shouldDoGoodDecap)
damageMod = damageType.default.goodDecapMod;
else
damageMod = damageType.default.badDecapMod;
if (nicePlayer != none)
hasTrashCleaner = class'NiceVeterancyTypes'.static.
hasSkill(nicePlayer, class'NiceSkillCommandoTrashCleaner');
if(hasTrashCleaner){
damageMod = FMin(
damageMod,
class'NiceSkillCommandoTrashCleaner'.default.
decapitationMultiLimit
);
}
return damageMod;
if (hasTrashCleaner)
{
damageMod = FMin(damageMod, class'NiceSkillCommandoTrashCleaner'.default.decapitationMultiLimit);
}
return damageMod;
}
function DealDecapDamage( int damage,
Pawn instigatedBy,
Vector hitLocation,