From 23ba24314b544c94d7847d54c892c86d6d83fa18 Mon Sep 17 00:00:00 2001 From: Infi Date: Mon, 13 May 2024 01:45:29 +0200 Subject: [PATCH] Create emote bool only once --- ChatTwo/Message.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChatTwo/Message.cs b/ChatTwo/Message.cs index 5788e32..fc8c81e 100755 --- a/ChatTwo/Message.cs +++ b/ChatTwo/Message.cs @@ -181,6 +181,7 @@ internal class Message } } + var checkForEmotes = Code.IsPlayerMessage() && Plugin.Config.ShowEmotes; foreach (var chunk in oldChunks) { // Use as is if it's not a text chunk or it already has a payload. @@ -192,11 +193,10 @@ internal class Message continue; } - var checkForEmotes = Code.IsPlayerMessage(); var builder = new StringBuilder(); foreach (var word in text.Content.Split(" ")) { - if (checkForEmotes && Plugin.Config.ShowEmotes && EmoteCache.Exists(word) && !Plugin.Config.BlockedEmotes.Contains(word)) + if (checkForEmotes && EmoteCache.Exists(word) && !Plugin.Config.BlockedEmotes.Contains(word)) { // We add all the previous collected text parts AddContentAfterURLCheck(builder.ToString(), text, chunk);