Unrevert audio (#21330)

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
This commit is contained in:
metalgearsloth
2023-11-27 22:12:34 +11:00
committed by GitHub
parent d3486d3b25
commit 269c93245d
288 changed files with 848 additions and 427 deletions

View File

@@ -5,6 +5,7 @@ using Content.Shared.Interaction;
using Content.Shared.Inventory.Events;
using Content.Shared.Radiation.Components;
using Content.Shared.Radiation.Systems;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Server.Player;
@@ -149,7 +150,7 @@ public sealed class GeigerSystem : SharedGeigerSystem
if (!Resolve(uid, ref component, false))
return;
component.Stream?.Stop();
component.Stream = _audio.Stop(component.Stream);
if (!component.Sounds.TryGetValue(component.DangerLevel, out var sounds))
return;
@@ -163,7 +164,7 @@ public sealed class GeigerSystem : SharedGeigerSystem
var sound = _audio.GetSound(sounds);
var param = sounds.Params.WithLoop(true).WithVolume(-4f);
component.Stream = _audio.PlayGlobal(sound, session, param);
component.Stream = _audio.PlayGlobal(sound, session, param)?.Entity;
}
public static GeigerDangerLevel RadsToLevel(float rads)