if (!CanSendInGame(message, shell, player))
return;
+ ignoreActionBlocker = CheckIgnoreSpeechBlocker(source, ignoreActionBlocker);
+
// this method is a disaster
// every second i have to spend working with this code is fucking agony
// scientists have to wonder how any of this was merged
{
if (TryProccessRadioMessage(source, message, out var modMessage, out var channel))
{
- SendEntityWhisper(source, modMessage, range, channel, nameOverride, ignoreActionBlocker);
+ SendEntityWhisper(source, modMessage, range, channel, nameOverride, hideLog, ignoreActionBlocker);
return;
}
}
return ev.Message;
}
+
+ public bool CheckIgnoreSpeechBlocker(EntityUid sender, bool ignoreBlocker)
+ {
+ if (ignoreBlocker)
+ return ignoreBlocker;
+
+ var ev = new CheckIgnoreSpeechBlockerEvent(sender, ignoreBlocker);
+ RaiseLocalEvent(sender, ev, true);
+
+ return ev.IgnoreBlocker;
+ }
private IEnumerable<INetChannel> GetDeadChatClients()
{
}
}
+public sealed class CheckIgnoreSpeechBlockerEvent : EntityEventArgs
+{
+ public EntityUid Sender;
+ public bool IgnoreBlocker;
+
+ public CheckIgnoreSpeechBlockerEvent(EntityUid sender, bool ignoreBlocker)
+ {
+ Sender = sender;
+ IgnoreBlocker = ignoreBlocker;
+ }
+}
+
/// <summary>
/// Raised on an entity when it speaks, either through 'say' or 'whisper'.
/// </summary>
--- /dev/null
+using Content.Server.Chat.Systems;
+using Content.Server.Speech.Components;
+
+namespace Content.Server.Speech.EntitySystems
+{
+ public sealed class UnblockableSpeechSystem : EntitySystem
+ {
+ public override void Initialize()
+ {
+ SubscribeLocalEvent<UnblockableSpeechComponent, CheckIgnoreSpeechBlockerEvent>(OnCheck);
+ }
+
+ private void OnCheck(EntityUid uid, UnblockableSpeechComponent component, CheckIgnoreSpeechBlockerEvent args)
+ {
+ args.IgnoreBlocker = true;
+ }
+ }
+}