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:
parent
05d41328ca
commit
1565609995
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user