Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Content.Server/Communications/CommunicationsConsoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CommunicationsConsoleComponent> 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);
}

/// <summary>
Expand Down Expand Up @@ -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<CommunicationsConsoleComponent> 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ public void UpdateAccess(
IReadOnlyList<string> activeLevels,
IReadOnlyCollection<ProtoId<AccessGroupPrototype>>? 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
Comment thread
Alexnov33X marked this conversation as resolved.
ent.Comp.AdditionalGroups.Clear();

foreach (var level in activeLevels)
Expand Down
Loading