From f1785e73dbba782d3a4055f5bca83b9066144da4 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Thu, 21 Nov 2024 00:32:54 +0100 Subject: [PATCH] portrait: Use UnitClass to get accurate info on AI players --- elements/portrait.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/elements/portrait.lua b/elements/portrait.lua index 1a6f9bf9..538bd65f 100644 --- a/elements/portrait.lua +++ b/elements/portrait.lua @@ -71,7 +71,13 @@ local function Update(self, event, unit) element:SetUnit(unit) end else - local class = element.showClass and UnitClassBase(unit) + local class, _ + if(element.showClass) then + -- BUG: UnitClassBase can't be trusted + -- https://github.com/Stanzilla/WoWUIBugs/issues/621 + _, class = UnitClass(unit) + end + if(class) then element:SetAtlas('classicon-' .. class) else