Category: Code.
Summary: At least one more hit actor being added into impact list upon shooting through any ZED with any weapon that has some penetration power on it.
Most common example on practice - you have a weapon that has some penetration power, such as 1911. There are two ZEDs lined up in front of you. Their penetration resistance does not matter. You shoot through the first ZED while aiming at ZED #2. Both ZEDs being added into impact list.
Of cause ZED #2 will not take any damage if the first one will absorb all the penetration power of the weapon, but doing so will still trigger Rack 'Em Up counter.
This is the case for both, instant firing and projectile firing.
Boring description:
The way weapon builds its list of actors to hit (Engine package, Weapon.uc, CalcWeaponFire) is that it uses recursion for every next HitActor if its PassThroughDamage(HitActor) returns true for the current one. I.e. function repeat itself and adds actors to hit as long as PassThroughDamage(HitActor) gives true.
Now if you look at PassThroughDamage(HitActor) of KFWeapon.uc
It will always be returning TRUE here for your first HitActor because all it cares about is how much penetration power weapon has. And your weapon does have penetration power before going through.
Possible solution here is to add check of whether it will ACTUALLY penetrate ZED or not based on its resistance.
It worked for me and no headshots were registered when i was shooting through ZEDs tough enough to absorb all the power weapon had.
Summary: At least one more hit actor being added into impact list upon shooting through any ZED with any weapon that has some penetration power on it.
Most common example on practice - you have a weapon that has some penetration power, such as 1911. There are two ZEDs lined up in front of you. Their penetration resistance does not matter. You shoot through the first ZED while aiming at ZED #2. Both ZEDs being added into impact list.
Of cause ZED #2 will not take any damage if the first one will absorb all the penetration power of the weapon, but doing so will still trigger Rack 'Em Up counter.
This is the case for both, instant firing and projectile firing.
Boring description:
Spoiler!
The way weapon builds its list of actors to hit (Engine package, Weapon.uc, CalcWeaponFire) is that it uses recursion for every next HitActor if its PassThroughDamage(HitActor) returns true for the current one. I.e. function repeat itself and adds actors to hit as long as PassThroughDamage(HitActor) gives true.
Now if you look at PassThroughDamage(HitActor) of KFWeapon.uc
Spoiler!
Code:
simulated function bool PassThroughDamage(Actor HitActor)
{
local KFPawn KFP;
if ( HitActor.bBlockActors )
{
KFP = KFPawn(HitActor);
if ( PenetrationPowerRemaining > 0 && KFP != none )
{
PenetrationPowerRemaining -= KFP.PenetrationResistance;
return true;
}
}
return (!HitActor.bBlockActors && (HitActor.IsA('Trigger') || HitActor.IsA('TriggerVolume')
|| HitActor.IsA('InteractiveFoliageActor') || HitActor.IsA('KFWaterMeshActor')));
}
It will always be returning TRUE here for your first HitActor because all it cares about is how much penetration power weapon has. And your weapon does have penetration power before going through.
Possible solution here is to add check of whether it will ACTUALLY penetrate ZED or not based on its resistance.
Spoiler!
Code:
simulated function bool PassThroughDamage(Actor HitActor)
{
local KFPawn KFP;
if ( HitActor.bBlockActors )
{
KFP = KFPawn(HitActor);
if ( PenetrationPowerRemaining > 0 && KFP != none [COLOR=#00FF00]&& PenetrationPowerRemaining > KFP.PenetrationResistance[/COLOR])
{
PenetrationPowerRemaining -= KFP.PenetrationResistance;
return true;
}
}
return (!HitActor.bBlockActors && (HitActor.IsA('Trigger') || HitActor.IsA('TriggerVolume')
|| HitActor.IsA('InteractiveFoliageActor') || HitActor.IsA('KFWaterMeshActor')));
}
It worked for me and no headshots were registered when i was shooting through ZEDs tough enough to absorb all the power weapon had.
Last edited: