From e0ca00022567c3b5a206dabdbdfc1e970da18f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Ueti?= <52474532+Mirino97@users.noreply.github.com> Date: Sun, 7 Aug 2022 04:10:39 -0300 Subject: [PATCH] Adds a check for hitSoundOverride in meleeWeaponSystem (#10380) --- Content.Server/Weapon/Melee/MeleeWeaponSystem.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs b/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs index 7f3013e2b8..72ccae1bef 100644 --- a/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs +++ b/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs @@ -112,7 +112,9 @@ namespace Content.Server.Weapon.Melee } else { - SoundSystem.Play(comp.NoDamageSound.GetSound(), Filter.Pvs(owner, entityManager: EntityManager), owner); + SoundSystem.Play((hitEvent.HitSoundOverride != null) + ? hitEvent.HitSoundOverride.GetSound() + : comp.NoDamageSound.GetSound(), Filter.Pvs(owner, entityManager: EntityManager), owner); } } } @@ -208,7 +210,9 @@ namespace Content.Server.Weapon.Melee } else { - SoundSystem.Play(comp.NoDamageSound.GetSound(), Filter.Pvs(owner, entityManager: EntityManager), owner); + SoundSystem.Play((hitEvent.HitSoundOverride != null) + ? hitEvent.HitSoundOverride.GetSound() + : comp.NoDamageSound.GetSound(), Filter.Pvs(owner, entityManager: EntityManager), owner); } } else