Audio fixes (#22324)

This commit is contained in:
metalgearsloth
2023-12-11 21:26:55 +11:00
committed by GitHub
parent 26a1198d3a
commit 1bdf94da64
5 changed files with 46 additions and 5 deletions

View File

@@ -1,7 +1,9 @@
using Content.Server.GameTicking.Events;
using Content.Shared.Audio;
using Content.Shared.GameTicking;
using Robust.Server.Audio;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Components;
using Robust.Shared.Prototypes;
namespace Content.Server.Audio;
@@ -14,10 +16,16 @@ public sealed class ContentAudioSystem : SharedContentAudioSystem
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundCleanup);
SubscribeLocalEvent<RoundStartingEvent>(OnRoundStart);
_protoManager.PrototypesReloaded += OnProtoReload;
}
private void OnRoundCleanup(RoundRestartCleanupEvent ev)
{
SilenceAudio();
}
private void OnProtoReload(PrototypesReloadedEventArgs obj)
{
if (!obj.ByType.ContainsKey(typeof(AudioPresetPrototype)))