From 1b00f70dcc433f0205d55e861346cb4c4f6f6d79 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Mon, 5 Sep 2022 00:13:20 +1200 Subject: [PATCH] Fix alerts not showing up when attaching to a new entity. (#11009) --- Content.Client/Alerts/ClientAlertsSystem.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Content.Client/Alerts/ClientAlertsSystem.cs b/Content.Client/Alerts/ClientAlertsSystem.cs index 1f428584ed..9981c54381 100644 --- a/Content.Client/Alerts/ClientAlertsSystem.cs +++ b/Content.Client/Alerts/ClientAlertsSystem.cs @@ -66,15 +66,13 @@ internal sealed class ClientAlertsSystem : AlertsSystem private void ClientAlertsHandleState(EntityUid uid, AlertsComponent component, ref ComponentHandleState args) { - if (_playerManager.LocalPlayer?.ControlledEntity != uid) - return; - var componentAlerts = (args.Current as AlertsComponentState)?.Alerts; if (componentAlerts == null) return; component.Alerts = new(componentAlerts); - SyncAlerts?.Invoke(this, componentAlerts); + if (_playerManager.LocalPlayer?.ControlledEntity == uid) + SyncAlerts?.Invoke(this, componentAlerts); } private void OnPlayerAttached(EntityUid uid, AlertsComponent component, PlayerAttachedEvent args)