Make AllowedEmotes bypass whitelists and fix syndiborg ability to laugh (#31510)

This commit is contained in:
lzk
2025-02-17 22:59:33 +01:00
committed by GitHub
parent 5ccea54299
commit 3d7e7e8320
2 changed files with 20 additions and 5 deletions

View 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)))
return false;
// 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;
}
if (!emote.Available &&
TryComp<SpeechComponent>(source, out var speech) &&
!speech.AllowedEmotes.Contains(emote.ID))
// Check the whitelist and blacklist
if (_whitelistSystem.IsWhitelistFail(emote.Whitelist, source) ||
_whitelistSystem.IsBlacklistPass(emote.Blacklist, source))
{
return false;
}
// 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);

View File

@@ -324,6 +324,8 @@
- type: MovementAlwaysTouching
- type: Speech
speechSounds: SyndieBorg
allowedEmotes:
- Laugh
- type: Vocal
sounds:
Unsexed: UnisexSiliconSyndicate