Fix alerts not showing up when attaching to a new entity. (#11009)
This commit is contained in:
@@ -66,14 +66,12 @@ internal sealed class ClientAlertsSystem : AlertsSystem
|
|||||||
|
|
||||||
private void ClientAlertsHandleState(EntityUid uid, AlertsComponent component, ref ComponentHandleState args)
|
private void ClientAlertsHandleState(EntityUid uid, AlertsComponent component, ref ComponentHandleState args)
|
||||||
{
|
{
|
||||||
if (_playerManager.LocalPlayer?.ControlledEntity != uid)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var componentAlerts = (args.Current as AlertsComponentState)?.Alerts;
|
var componentAlerts = (args.Current as AlertsComponentState)?.Alerts;
|
||||||
if (componentAlerts == null) return;
|
if (componentAlerts == null) return;
|
||||||
|
|
||||||
component.Alerts = new(componentAlerts);
|
component.Alerts = new(componentAlerts);
|
||||||
|
|
||||||
|
if (_playerManager.LocalPlayer?.ControlledEntity == uid)
|
||||||
SyncAlerts?.Invoke(this, componentAlerts);
|
SyncAlerts?.Invoke(this, componentAlerts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user