From 64e882bb6d70bddbf2560005e1fa36665ff65eb9 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Wed, 15 Feb 2023 00:53:13 -0500 Subject: [PATCH] fix radiosystem popup (#14121) --- Content.Server/Radio/EntitySystems/RadioSystem.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Content.Server/Radio/EntitySystems/RadioSystem.cs b/Content.Server/Radio/EntitySystems/RadioSystem.cs index e85014f1d9..6580afc17f 100644 --- a/Content.Server/Radio/EntitySystems/RadioSystem.cs +++ b/Content.Server/Radio/EntitySystems/RadioSystem.cs @@ -71,26 +71,27 @@ public sealed class RadioSystem : EntitySystem var ev = new RadioReceiveEvent(message, source, channel, chatMsg, radioSource); var attemptEv = new RadioReceiveAttemptEvent(message, source, channel, radioSource); - bool sentAtLeastOnce = false; + var sentAtLeastOnce = false; foreach (var radio in EntityQuery()) { + var ent = radio.Owner; // TODO map/station/range checks? if (!radio.Channels.Contains(channel.ID)) continue; - RaiseLocalEvent(radio.Owner, attemptEv); + RaiseLocalEvent(ent, attemptEv); if (attemptEv.Cancelled) { attemptEv.Uncancel(); continue; } sentAtLeastOnce = true; - RaiseLocalEvent(radio.Owner, ev); + RaiseLocalEvent(ent, ev); } if (!sentAtLeastOnce) - _popupSystem.PopupEntity(Loc.GetString("failed-to-send-message"), source, PopupType.MediumCaution); + _popupSystem.PopupEntity(Loc.GetString("failed-to-send-message"), source, source, PopupType.MediumCaution); if (name != Name(source)) _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Radio message from {ToPrettyString(source):user} as {name} on {channel.LocalizedName}: {message}"); -- 2.52.0