Read nameplate units directly instead of scanning by name

This commit is contained in:
Brues
2026-10-31 15:08:39 -05:00
parent f81ea09d1c
commit e43ddd31fd
3 changed files with 63 additions and 138 deletions
+4 -1
View File
@@ -59,7 +59,10 @@ pfUI:RegisterModule("afkcam", function ()
if not this:IsVisible() then return end
local info = _G.ChatTypeInfo[string.gsub(event,"CHAT_MSG_","")]
if not info then return end
local class = GetUnitInfo(arg2 or "")
-- the engine name-queries a chat sender before the event fires, so the
-- sender's GUID (arg12) always resolves
local _, class
if arg12 and arg12 ~= "" then _, class = GetPlayerInfoByGUID(arg12) end
local author, msg
if class and class ~= UNKNOWN then
local class_color = PFUI_CLASS_COLORS[class]:GenerateHexColorMarkup()