replacing sound (collection) names with SoundSpecifier - part 1

This commit is contained in:
Galactic Chimp
2021-07-10 17:35:33 +02:00
parent 4500b66f28
commit ce3c59e0e6
131 changed files with 934 additions and 587 deletions

View File

@@ -11,6 +11,7 @@ using Content.Shared.Examine;
using Content.Shared.Maps;
using Content.Shared.Physics;
using Content.Shared.Slippery;
using Content.Shared.Sound;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
@@ -71,7 +72,7 @@ namespace Content.Server.Fluids.Components
public float EvaporateTime { get; private set; } = 5f;
[DataField("spill_sound")]
private string _spillSound = "/Audio/Effects/Fluids/splat.ogg";
private SoundSpecifier _spillSound = new SoundPathSpecifier("/Audio/Effects/Fluids/splat.ogg");
/// <summary>
/// Whether or not this puddle is currently overflowing onto its neighbors
@@ -189,7 +190,8 @@ namespace Content.Server.Fluids.Components
return true;
}
SoundSystem.Play(Filter.Pvs(Owner), _spillSound, Owner.Transform.Coordinates);
if(_spillSound.TryGetSound(out var spillSound))
SoundSystem.Play(Filter.Pvs(Owner), spillSound, Owner.Transform.Coordinates);
return true;
}