From 156560999539b8263b0b3f5ac8939d45a808cb84 Mon Sep 17 00:00:00 2001 From: Sony-dev <62094119+Sony-dev@users.noreply.github.com> Date: Thu, 24 Nov 2022 06:43:32 +0000 Subject: [PATCH] Fix for odd errors with other text modifiers (#99) Sometimes other addons that hook PlayerSay and return modified strings break this easychat module. Replacing 'if prefix then' with a string type check fixes this. (At least in my testing) --- lua/easychat/modules/client/darkrp.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/easychat/modules/client/darkrp.lua b/lua/easychat/modules/client/darkrp.lua index de92471..0618318 100644 --- a/lua/easychat/modules/client/darkrp.lua +++ b/lua/easychat/modules/client/darkrp.lua @@ -19,7 +19,8 @@ hook.Add("ECPostInitialized", "EasyChatModuleDarkRP", function() EasyChat.AddNameTags(ply, msg_components) - if prefix then + -- Check if prefix is a string, as some text modifiers can return odd things here. + if type(prefix) == "string" then if col1 == team.GetColor(ply:Team()) then -- Just prettier col1 = color_white end @@ -48,4 +49,4 @@ hook.Add("ECPostInitialized", "EasyChatModuleDarkRP", function() end end) -return "DarkRP Compat" \ No newline at end of file +return "DarkRP Compat"