From f7287b181d51b46717a430c875644b51b9f181df Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:48:37 +1000 Subject: [PATCH] Fix audioparams for playglobal (#5437) --- Robust.Shared/Audio/Systems/SharedAudioSystem.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Robust.Shared/Audio/Systems/SharedAudioSystem.cs b/Robust.Shared/Audio/Systems/SharedAudioSystem.cs index 9fff8c8fb94..e58c0ed36c1 100644 --- a/Robust.Shared/Audio/Systems/SharedAudioSystem.cs +++ b/Robust.Shared/Audio/Systems/SharedAudioSystem.cs @@ -428,7 +428,7 @@ public TimeSpan GetAudioLength(string filename) [return: NotNullIfNotNull("sound")] public (EntityUid Entity, Components.AudioComponent Component)? PlayGlobal(SoundSpecifier? sound, Filter playerFilter, bool recordReplay, AudioParams? audioParams = null) { - return sound == null ? null : PlayGlobal(GetSound(sound), playerFilter, recordReplay, sound.Params); + return sound == null ? null : PlayGlobal(GetSound(sound), playerFilter, recordReplay, audioParams ?? sound.Params); } /// @@ -445,9 +445,9 @@ public TimeSpan GetAudioLength(string filename) /// The sound specifier that points the audio file(s) that should be played. /// The player that will hear the sound. [return: NotNullIfNotNull("sound")] - public (EntityUid Entity, Components.AudioComponent Component)? PlayGlobal(SoundSpecifier? sound, ICommonSession recipient) + public (EntityUid Entity, Components.AudioComponent Component)? PlayGlobal(SoundSpecifier? sound, ICommonSession recipient, AudioParams? audioParams = null) { - return sound == null ? null : PlayGlobal(GetSound(sound), recipient, sound.Params); + return sound == null ? null : PlayGlobal(GetSound(sound), recipient, audioParams ?? sound.Params); } public abstract void LoadStream(Entity entity, T stream); @@ -468,7 +468,7 @@ public TimeSpan GetAudioLength(string filename) [return: NotNullIfNotNull("sound")] public (EntityUid Entity, Components.AudioComponent Component)? PlayGlobal(SoundSpecifier? sound, EntityUid recipient, AudioParams? audioParams = null) { - return sound == null ? null : PlayGlobal(GetSound(sound), recipient, sound.Params); + return sound == null ? null : PlayGlobal(GetSound(sound), recipient, audioParams ?? sound.Params); } ///