Make EmitSoundOnUseComponent use the AudioSystem directly instead of SoundComponent
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Shared.Audio;
|
using Content.Shared.Audio;
|
||||||
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Sound
|
namespace Content.Server.GameObjects.Components.Sound
|
||||||
@@ -32,10 +34,10 @@ namespace Content.Server.GameObjects.Components.Sound
|
|||||||
{
|
{
|
||||||
if (_pitchVariation > 0.0)
|
if (_pitchVariation > 0.0)
|
||||||
{
|
{
|
||||||
Owner.GetComponent<SoundComponent>().Play(_soundName, AudioHelpers.WithVariation(_pitchVariation).WithVolume(-2f));
|
EntitySystem.Get<AudioSystem>().Play(_soundName, Owner, AudioHelpers.WithVariation(_pitchVariation).WithVolume(-2f));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Owner.GetComponent<SoundComponent>().Play(_soundName, AudioParams.Default.WithVolume(-2f));
|
EntitySystem.Get<AudioSystem>().Play(_soundName, Owner, AudioParams.Default.WithVolume(-2f));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
sprite: Objects/Fun/bikehorn.rsi
|
sprite: Objects/Fun/bikehorn.rsi
|
||||||
- type: ItemCooldown
|
- type: ItemCooldown
|
||||||
|
|
||||||
- type: Sound
|
|
||||||
- type: EmitSoundOnUse
|
- type: EmitSoundOnUse
|
||||||
sound: /Audio/items/bikehorn.ogg
|
sound: /Audio/items/bikehorn.ogg
|
||||||
variation: 0.2
|
variation: 0.2
|
||||||
|
|||||||
Reference in New Issue
Block a user