Skip to content

Commit

Permalink
Only Play Sniper Impact Sound When Dealing Damage
Browse files Browse the repository at this point in the history
  • Loading branch information
Deaod committed Apr 16, 2024
1 parent ed8cdb3 commit a16e75d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Classes/ST_SniperRifle.uc
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,23 @@ function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vect
if (Other == Level) {
Spawn(class'UT_HeavyWallHitEffect',,, HitLocation+HitNormal, Rotator(HitNormal));
} else if ((Other != self) && (Other != Owner) && (Other != None)) {
if (Other.bIsPawn)
Other.PlaySound(Sound 'ChunkHit',, 4.0,,100);
if (Other.bIsPawn && STM.CheckHeadshot(Pawn(Other), HitLocation, X) &&
(instigator.IsA('PlayerPawn') || (instigator.IsA('Bot') && !Bot(Instigator).bNovice))
) {
Other.PlaySound(Sound 'ChunkHit',, 4.0,,100);
Other.TakeDamage(
STM.WeaponSettings.SniperHeadshotDamage,
PawnOwner,
HitLocation,
STM.WeaponSettings.SniperHeadshotMomentum * 35000 * X,
AltDamageType);
} else if (Other.bIsPawn == false || STM.CheckBodyShot(Pawn(Other), HitLocation, X)) {
if (Other.bIsPawn)
if (Other.bIsPawn) {
Other.PlaySound(Sound 'ChunkHit',, 4.0,,100);
Momentum = STM.WeaponSettings.SniperMomentum * 30000.0*X;
else
} else {
Momentum = 30000.0*X;
}

Other.TakeDamage(
STM.WeaponSettings.SniperDamage,
Expand Down

0 comments on commit a16e75d

Please sign in to comment.