diff --git a/Content.Server/Communications/CommunicationsConsoleSystem.cs b/Content.Server/Communications/CommunicationsConsoleSystem.cs index 1a8db1c0d4..df8d80ddd3 100644 --- a/Content.Server/Communications/CommunicationsConsoleSystem.cs +++ b/Content.Server/Communications/CommunicationsConsoleSystem.cs @@ -115,11 +115,11 @@ public override void Update(float frameTime) base.Update(frameTime); } - public void OnCommunicationsConsoleMapInit(EntityUid uid, CommunicationsConsoleComponent comp, MapInitEvent args) + public void OnCommunicationsConsoleMapInit(Entity entity, ref MapInitEvent args) { - comp.AnnouncementCooldownRemaining = comp.InitialDelay; - EnsureAlertStation((uid, comp)); // Sunrise-Edit - UpdateCommsConsoleInterface(uid, comp); + entity.Comp.AnnouncementCooldownRemaining = entity.Comp.InitialDelay; + EnsureAlertStation(entity); // Sunrise-Edit + UpdateCommsConsoleInterface(entity.Owner, entity.Comp); } /// @@ -265,13 +265,13 @@ private bool CanCallOrRecall(CommunicationsConsoleComponent comp) return !(left.TotalSeconds / expected.TotalSeconds < recallThreshold); } - private void OnSelectAlertLevelMessage(EntityUid uid, CommunicationsConsoleComponent comp, CommunicationsConsoleSelectAlertLevelMessage message) + private void OnSelectAlertLevelMessage(Entity entity, ref CommunicationsConsoleSelectAlertLevelMessage message) { if (message.Actor is not { Valid: true } user) return; - TrySetPrimaryAlertLevel((uid, comp), message.Level, user); // Sunrise-Edit - UpdateCommsConsoleInterface(uid, comp); // Sunrise-Edit - отправляем состояние после установки force cooldown. + TrySetPrimaryAlertLevel((entity.Owner, entity.Comp), message.Level, user); // Sunrise-Edit + UpdateCommsConsoleInterface(entity.Owner, entity.Comp); // Sunrise-Edit - отправляем состояние после установки force cooldown. } private void OnAnnounceMessage(EntityUid uid, CommunicationsConsoleComponent comp, diff --git a/Content.Shared/_Sunrise/Access/Systems/AccessReaderSystem.AlertLevels.cs b/Content.Shared/_Sunrise/Access/Systems/AccessReaderSystem.AlertLevels.cs index 81284d78fd..d10684d4a6 100644 --- a/Content.Shared/_Sunrise/Access/Systems/AccessReaderSystem.AlertLevels.cs +++ b/Content.Shared/_Sunrise/Access/Systems/AccessReaderSystem.AlertLevels.cs @@ -54,7 +54,12 @@ public void UpdateAccess( IReadOnlyList activeLevels, IReadOnlyCollection>? globalGroups = null) { - ent.Comp.Group = ent.Comp.AlertAccesses.GetValueOrDefault(primaryLevel); + // FIsh edit start - отсутствие группы кода не должно создавать пустой ProtoId. + if (ent.Comp.AlertAccesses.TryGetValue(primaryLevel, out var primaryGroup)) + ent.Comp.Group = primaryGroup; + else + ent.Comp.Group = null; + // FIsh edit end ent.Comp.AdditionalGroups.Clear(); foreach (var level in activeLevels)