IListener and IRadio purge (#11980)

This commit is contained in:
Leon Friedrich
2022-11-15 17:09:27 +13:00
committed by GitHub
parent bc525425da
commit 0b5a58001c
48 changed files with 946 additions and 643 deletions

View File

@@ -1,6 +1,6 @@
using System.Linq;
using System.Text.RegularExpressions;
using Content.Server.Headset;
using Content.Server.Radio.Components;
using Content.Shared.Radio;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
@@ -76,12 +76,9 @@ public sealed partial class ChatSystem
// Re-capitalize message since we removed the prefix.
message = SanitizeMessageCapital(message);
if (_inventory.TryGetSlotEntity(source, "ears", out var entityUid) &&
TryComp(entityUid, out HeadsetComponent? headset))
{
headset.RadioRequested = true;
}
else
var hasHeadset = _inventory.TryGetSlotEntity(source, "ears", out var entityUid) && HasComp<HeadsetComponent>(entityUid);
if (!hasHeadset && !HasComp<IntrinsicRadioTransmitterComponent>(source))
{
_popup.PopupEntity(Loc.GetString("chat-manager-no-headset-on-message"), source, Filter.Entities(source));
}