]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix glorfcode for real (#22838)
authorKara <lunarautomaton6@gmail.com>
Fri, 22 Dec 2023 00:23:22 +0000 (17:23 -0700)
committerGitHub <noreply@github.com>
Fri, 22 Dec 2023 00:23:22 +0000 (16:23 -0800)
Fix glorfcode

Content.Client/UserInterface/Systems/Chat/ChatUIController.cs
Content.Shared/Damage/ForceSay/DamageForceSayComponent.cs

index 0213eb5902697670d94cfc93852d410ae4d4e27c..ba77dc273adb4657d85d50c43dd046f09ae6b4e7 100644 (file)
@@ -712,20 +712,23 @@ public sealed class ChatUIController : UIController
 
         var msg = chatBox.ChatInput.Input.Text.TrimEnd();
         // Don't send on OOC/LOOC obviously!
-        if (SplitInputContents(msg).chatChannel
-                is not (
-                    ChatSelectChannel.Local or
-                    ChatSelectChannel.Radio or
-                    ChatSelectChannel.Whisper
-                )
-            )
+
+        // we need to handle selected channel
+        // and prefix-channel separately..
+        var allowedChannels = ChatSelectChannel.Local | ChatSelectChannel.Whisper;
+        if ((chatBox.SelectedChannel & allowedChannels) == ChatSelectChannel.None)
+            return;
+
+        // none can be returned from this if theres no prefix,
+        // so we allow it in that case (assuming the previous check will have exited already if its an invalid channel)
+        var prefixChannel = SplitInputContents(msg).chatChannel;
+        if (prefixChannel != ChatSelectChannel.None && (prefixChannel & allowedChannels) == ChatSelectChannel.None)
             return;
 
         if (_player.LocalSession?.AttachedEntity is not { } ent
             || !EntityManager.TryGetComponent<DamageForceSayComponent>(ent, out var forceSay))
             return;
 
-
         if (string.IsNullOrWhiteSpace(msg))
             return;
 
index dc2617bc93e93d1a942921a77597a5dc62a7deff..163cc7cbf4ccb33db9b07155524b12d2fecb67da 100644 (file)
@@ -44,7 +44,7 @@ public sealed partial class DamageForceSayComponent : Component
     ///     a force say occurs.
     /// </summary>
     [DataField]
-    public FixedPoint2 DamageThreshold = FixedPoint2.New(10);
+    public FixedPoint2 DamageThreshold = FixedPoint2.New(5);
 
     /// <summary>
     ///     A list of damage group types that are considered when checking <see cref="DamageThreshold"/>.