From dd1639d3435ec757d13ab221bea96ff4177662e7 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Tue, 25 Aug 2026 20:41:57 +0200 Subject: [PATCH] Restore gray fallback for unknown chat classes --- mods/social-colors.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mods/social-colors.lua b/mods/social-colors.lua index 130861b..692bd44 100644 --- a/mods/social-colors.lua +++ b/mods/social-colors.lua @@ -36,13 +36,15 @@ do -- add class colors to chat if text then for name in gfind(text, "|Hplayer:(.-)|h") do local real = strsplit(":", name) + local color = "|cffaaaaaa" local class = GetUnitData(real) - if class and class ~= UNKNOWN then - local color = rgbhex(RAID_CLASS_COLORS[class]) - text = string.gsub(text, - "|Hplayer:"..name.."|h%["..real.."%]|h(.-:-)", - "|r["..color.."|Hplayer:"..name.."|h"..color..real.."|h|r]|r%1") + local classColor = class and class ~= UNKNOWN and RAID_CLASS_COLORS[class] + if classColor then + color = rgbhex(classColor) end + text = string.gsub(text, + "|Hplayer:"..name.."|h%["..real.."%]|h(.-:-)", + "|r["..color.."|Hplayer:"..name.."|h"..color..real.."|h|r]|r%1") end end frame.HookAddMessageColor(frame, text, a1, a2, a3, a4, a5) @@ -238,4 +240,4 @@ do -- add class colors to chat end end) end -end +end \ No newline at end of file