Files
tbd-station-14/Content.Server/Alert/ServerAlertsSystem.cs
metalgearsloth a9a6b98f99 Fix alerts mispredict + log spam (#36004)
tstalker alerted me to it and noticed the classic case of shallow copies.
2025-03-22 12:41:16 +01:00

21 lines
540 B
C#

using Content.Shared.Alert;
using Robust.Shared.GameStates;
namespace Content.Server.Alert;
internal sealed class ServerAlertsSystem : AlertsSystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<AlertsComponent, ComponentGetState>(OnGetState);
}
private void OnGetState(Entity<AlertsComponent> alerts, ref ComponentGetState args)
{
// TODO: Use sourcegen when clone-state bug fixed.
args.State = new AlertComponentState(new(alerts.Comp.Alerts));
}
}