From 6d9f2b5a687399b3bf8d26dbe12cc913c624103e Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Sat, 8 Feb 2020 18:25:40 +0100 Subject: [PATCH] Fix attack sounds playing globally. --- .../Components/Weapon/Melee/MeleeWeaponComponent.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs index d16769ed5f..1d896aa9c9 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs @@ -102,7 +102,8 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee } var audioSystem = _entitySystemManager.GetEntitySystem(); - audioSystem.Play(hitEntities.Count > 0 ? _hitSound : "/Audio/weapons/punchmiss.ogg"); + var emitter = hitEntities.Count == 0 ? eventArgs.User : hitEntities[0]; + audioSystem.Play(hitEntities.Count > 0 ? _hitSound : "/Audio/weapons/punchmiss.ogg", emitter); if (Arc != null) {