Fix alerts not showing up when attaching to a new entity. (#11009)

This commit is contained in:
Leon Friedrich
2022-09-05 00:13:20 +12:00
committed by GitHub
parent d447b0f80e
commit 1b00f70dcc

View File

@@ -66,14 +66,12 @@ 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);
if (_playerManager.LocalPlayer?.ControlledEntity == uid)
SyncAlerts?.Invoke(this, componentAlerts);
}