replacing sound (collection) names with SoundSpecifier - part 1
This commit is contained in:
@@ -8,6 +8,7 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Helpers;
|
||||
using Content.Shared.Notification;
|
||||
using Content.Shared.Notification.Managers;
|
||||
using Content.Shared.Sound;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Localization;
|
||||
@@ -43,7 +44,7 @@ namespace Content.Server.Fluids.Components
|
||||
: ReagentUnit.Zero;
|
||||
|
||||
[DataField("sound")]
|
||||
private string? _sound = "/Audio/Effects/Fluids/watersplash.ogg";
|
||||
private SoundSpecifier _sound = new SoundPathSpecifier("/Audio/Effects/Fluids/watersplash.ogg");
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Initialize()
|
||||
@@ -114,9 +115,9 @@ namespace Content.Server.Fluids.Components
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_sound != null)
|
||||
if (_sound.TryGetSound(out var sound))
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _sound, Owner);
|
||||
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user