Make AllowedEmotes bypass whitelists and fix syndiborg ability to laugh (#31510)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -324,6 +324,8 @@
|
||||
- type: MovementAlwaysTouching
|
||||
- type: Speech
|
||||
speechSounds: SyndieBorg
|
||||
allowedEmotes:
|
||||
- Laugh
|
||||
- type: Vocal
|
||||
sounds:
|
||||
Unsexed: UnisexSiliconSyndicate
|
||||
|
||||
Reference in New Issue
Block a user