From b2aefdef37db379ae819335f8da9892277d140e5 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 29 Nov 2023 10:19:23 +1100 Subject: [PATCH] Set FTL sounds as grid audio (#21951) --- .../Systems/ShuttleSystem.FasterThanLight.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs index f505ce5960..fead51ed7c 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs @@ -15,6 +15,7 @@ using Content.Shared.Shuttles.Systems; using Content.Shared.StatusEffect; using JetBrains.Annotations; using Robust.Shared.Audio; +using Robust.Shared.Audio.Components; using Robust.Shared.Collections; using Robust.Shared.Map; using Robust.Shared.Map.Components; @@ -230,7 +231,8 @@ public sealed partial class ShuttleSystem component = AddComp(uid); component.State = FTLState.Starting; - _audio.PlayPvs(_startupSound, uid); + var audio = _audio.PlayPvs(_startupSound, uid); + audio.Value.Component.Flags |= AudioFlags.GridAudio; // Make sure the map is setup before we leave to avoid pop-in (e.g. parallax). SetupHyperspace(); return true; @@ -286,7 +288,10 @@ public sealed partial class ShuttleSystem var ev = new FTLStartedEvent(uid, target, fromMapUid, fromMatrix, fromRotation); RaiseLocalEvent(uid, ref ev, true); - comp.TravelStream = _audio.PlayPvs(comp.TravelSound, uid)?.Entity; + var wowdio = _audio.PlayPvs(comp.TravelSound, uid); + comp.TravelStream = wowdio?.Entity; + if (wowdio?.Component != null) + wowdio.Value.Component.Flags |= AudioFlags.GridAudio; break; // Arriving, play effects @@ -374,7 +379,8 @@ public sealed partial class ShuttleSystem } comp.TravelStream = _audio.Stop(comp.TravelStream); - _audio.PlayPvs(_arrivalSound, uid); + var audio = _audio.PlayPvs(_arrivalSound, uid); + audio.Value.Component.Flags |= AudioFlags.GridAudio; if (TryComp(uid, out var dest)) { -- 2.51.2