diff --git a/Content.Server/Sound/EmitSoundSystem.cs b/Content.Server/Sound/EmitSoundSystem.cs index c579fa54e1..42207d9eae 100644 --- a/Content.Server/Sound/EmitSoundSystem.cs +++ b/Content.Server/Sound/EmitSoundSystem.cs @@ -22,13 +22,33 @@ namespace Content.Server.Sound public override void Initialize() { base.Initialize(); - SubscribeLocalEvent((eUI, comp, arg) => HandleEmitSoundOn(comp)); - SubscribeLocalEvent((eUI, comp, arg) => HandleEmitSoundOn(comp)); - SubscribeLocalEvent((eUI, comp, arg) => HandleEmitSoundOn(comp)); - SubscribeLocalEvent((eUI, comp, args) => HandleEmitSoundOn(comp)); + SubscribeLocalEvent(HandleEmitSoundOnLand); + SubscribeLocalEvent(HandleEmitSoundOnUseInHand); + SubscribeLocalEvent(HandleEmitSoundOnThrown); + SubscribeLocalEvent(HandleEmitSoundOnActivateInWorld); } - private void HandleEmitSoundOn(BaseEmitSoundComponent component) + private void HandleEmitSoundOnLand(EntityUid eUI, BaseEmitSoundComponent component, LandEvent arg) + { + TryEmitSound(component); + } + + private void HandleEmitSoundOnUseInHand(EntityUid eUI, BaseEmitSoundComponent component, UseInHandEvent arg) + { + TryEmitSound(component); + } + + private void HandleEmitSoundOnThrown(EntityUid eUI, BaseEmitSoundComponent component, ThrownEvent arg) + { + TryEmitSound(component); + } + + private void HandleEmitSoundOnActivateInWorld(EntityUid eUI, BaseEmitSoundComponent component, ActivateInWorldEvent arg) + { + TryEmitSound(component); + } + + private static void TryEmitSound(BaseEmitSoundComponent component) { if (component.Sound.TryGetSound(out var soundName)) {