Use hitevent sound for swings (#6293)

This commit is contained in:
metalgearsloth
2022-01-25 11:22:25 +11:00
committed by GitHub
parent 775c18d525
commit c50f2a2a4e

View File

@@ -169,11 +169,18 @@ namespace Content.Server.Weapon.Melee
{
if (entities.Count != 0)
{
SoundSystem.Play(Filter.Pvs(owner), comp.HitSound.GetSound(), EntityManager.GetComponent<TransformComponent>(entities.First()).Coordinates);
if (hitEvent.HitSoundOverride != null)
{
SoundSystem.Play(Filter.Pvs(owner), hitEvent.HitSoundOverride.GetSound(), Transform(entities.First()).Coordinates);
}
else
{
SoundSystem.Play(Filter.Pvs(owner), comp.HitSound.GetSound(), Transform(entities.First()).Coordinates);
}
}
else
{
SoundSystem.Play(Filter.Pvs(owner), comp.MissSound.GetSound(), EntityManager.GetComponent<TransformComponent>(args.User).Coordinates);
SoundSystem.Play(Filter.Pvs(owner), comp.MissSound.GetSound(), Transform(args.User).Coordinates);
}
var modifiedDamage = DamageSpecifier.ApplyModifierSets(comp.Damage + hitEvent.BonusDamage, hitEvent.ModifiersList);