]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Make AllowedEmotes bypass whitelists and fix syndiborg ability to laugh (#31510)
authorlzk <124214523+lzk228@users.noreply.github.com>
Mon, 17 Feb 2025 21:59:33 +0000 (22:59 +0100)
committerGitHub <noreply@github.com>
Mon, 17 Feb 2025 21:59:33 +0000 (22:59 +0100)
Content.Server/Chat/Systems/ChatSystem.Emote.cs
Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml

index fddf453ff06481727e4694d55938ae08961cb3e2..707a0e0dc5d5887fe19526ceac5f2e392008bb89 100644 (file)
@@ -196,17 +196,30 @@ public partial class ChatSystem
     /// <returns></returns>
     private bool AllowedToUseEmote(EntityUid source, EmotePrototype emote)
     {
-        if ((_whitelistSystem.IsWhitelistFail(emote.Whitelist, source) || _whitelistSystem.IsBlacklistPass(emote.Blacklist, source)))
+        // If emote is in AllowedEmotes, it will bypass whitelist and blacklist
+        if (TryComp<SpeechComponent>(source, out var speech) &&
+            speech.AllowedEmotes.Contains(emote.ID))
+        {
+            return true;
+        }
+
+        // Check the whitelist and blacklist
+        if (_whitelistSystem.IsWhitelistFail(emote.Whitelist, source) ||
+            _whitelistSystem.IsBlacklistPass(emote.Blacklist, source))
+        {
             return false;
+        }
 
-        if (!emote.Available &&
-            TryComp<SpeechComponent>(source, out var speech) &&
-            !speech.AllowedEmotes.Contains(emote.ID))
+        // Check if the emote is available for all
+        if (!emote.Available)
+        {
             return false;
+        }
 
         return true;
     }
 
+
     private void InvokeEmoteEvent(EntityUid uid, EmotePrototype proto)
     {
         var ev = new EmoteEvent(proto);
index fdc6574c9495bb823b6332712aa7c5adad0b5af0..85ef048096ce2ec7e7706d538e632f39916da272 100644 (file)
   - type: MovementAlwaysTouching
   - type: Speech
     speechSounds: SyndieBorg
+    allowedEmotes:
+    - Laugh
   - type: Vocal
     sounds:
       Unsexed: UnisexSiliconSyndicate