Skip to content

Commit

Permalink
portrait: Use UnitClass to get accurate info on AI players
Browse files Browse the repository at this point in the history
  • Loading branch information
p3lim committed Nov 20, 2024
1 parent 91d0de9 commit f1785e7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion elements/portrait.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f1785e7

Please sign in to comment.