1
0
mirror of https://github.com/Earu/EasyChat.git synced 2025-03-04 03:13:20 -05:00

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)
This commit is contained in:
Sony-dev 2022-11-24 06:43:32 +00:00 committed by GitHub
parent 05d41328ca
commit 1565609995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"
return "DarkRP Compat"