From: lzk <124214523+lzk228@users.noreply.github.com> Date: Mon, 17 Feb 2025 21:59:33 +0000 (+0100) Subject: Make AllowedEmotes bypass whitelists and fix syndiborg ability to laugh (#31510) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=3d7e7e8320f25996f8f0bfc81e949a934b4aa989;p=space-station-14.git Make AllowedEmotes bypass whitelists and fix syndiborg ability to laugh (#31510) --- diff --git a/Content.Server/Chat/Systems/ChatSystem.Emote.cs b/Content.Server/Chat/Systems/ChatSystem.Emote.cs index fddf453ff0..707a0e0dc5 100644 --- a/Content.Server/Chat/Systems/ChatSystem.Emote.cs +++ b/Content.Server/Chat/Systems/ChatSystem.Emote.cs @@ -196,17 +196,30 @@ public partial class ChatSystem /// 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(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(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); diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index fdc6574c94..85ef048096 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -324,6 +324,8 @@ - type: MovementAlwaysTouching - type: Speech speechSounds: SyndieBorg + allowedEmotes: + - Laugh - type: Vocal sounds: Unsexed: UnisexSiliconSyndicate