From e5fb384edd8dab657dbace98d4dd7c6c63b723f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= Date: Wed, 27 May 2020 11:33:16 +0200 Subject: [PATCH] Make EmitSoundOnUseComponent use the AudioSystem directly instead of SoundComponent --- .../GameObjects/Components/Sound/EmitSoundOnUseComponent.cs | 6 ++++-- Resources/Prototypes/Entities/Items/bike_horn.yml | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Content.Server/GameObjects/Components/Sound/EmitSoundOnUseComponent.cs b/Content.Server/GameObjects/Components/Sound/EmitSoundOnUseComponent.cs index 0d01ce2bb9..b1f466f136 100644 --- a/Content.Server/GameObjects/Components/Sound/EmitSoundOnUseComponent.cs +++ b/Content.Server/GameObjects/Components/Sound/EmitSoundOnUseComponent.cs @@ -1,7 +1,9 @@ using Content.Server.GameObjects.EntitySystems; using Content.Shared.Audio; +using Robust.Server.GameObjects.EntitySystems; using Robust.Shared.Audio; using Robust.Shared.GameObjects; +using Robust.Shared.GameObjects.Systems; using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components.Sound @@ -32,10 +34,10 @@ namespace Content.Server.GameObjects.Components.Sound { if (_pitchVariation > 0.0) { - Owner.GetComponent().Play(_soundName, AudioHelpers.WithVariation(_pitchVariation).WithVolume(-2f)); + EntitySystem.Get().Play(_soundName, Owner, AudioHelpers.WithVariation(_pitchVariation).WithVolume(-2f)); return true; } - Owner.GetComponent().Play(_soundName, AudioParams.Default.WithVolume(-2f)); + EntitySystem.Get().Play(_soundName, Owner, AudioParams.Default.WithVolume(-2f)); return true; } return false; diff --git a/Resources/Prototypes/Entities/Items/bike_horn.yml b/Resources/Prototypes/Entities/Items/bike_horn.yml index 8314634c1c..42101afb02 100644 --- a/Resources/Prototypes/Entities/Items/bike_horn.yml +++ b/Resources/Prototypes/Entities/Items/bike_horn.yml @@ -17,7 +17,6 @@ sprite: Objects/Fun/bikehorn.rsi - type: ItemCooldown - - type: Sound - type: EmitSoundOnUse sound: /Audio/items/bikehorn.ogg variation: 0.2