diff --git a/src/types/unitframe.lua b/src/types/unitframe.lua index 0767e41..9795856 100644 --- a/src/types/unitframe.lua +++ b/src/types/unitframe.lua @@ -541,10 +541,20 @@ function UnitFrame:UNIT_POWER_UPDATE() self:UpdatePower() end -function UnitFrame:UpdateRole(role) +function UnitFrame:GetRole(role) if role == nil then role = UnitGroupRolesAssigned(self.unit) end + + if GetPartyAssignment("MAINTANK", self.unit) then + role = "TANK" + end + + return role +end + +function UnitFrame:UpdateRole(role) + role = self:GetRole(role) if role == "HEALER" then self:EnablePower(Enum.PowerType.Mana) elseif role == "TANK" and select(3, UnitClass(self.unit)) == 6 then diff --git a/src/types/unitgroup.lua b/src/types/unitgroup.lua index d534451..92cecf9 100644 --- a/src/types/unitgroup.lua +++ b/src/types/unitgroup.lua @@ -53,8 +53,8 @@ local function UnitFrameDefaultCompare(lhs, rhs) end -- tank < healer < damage < ? - local lrole = RoleValue(UnitGroupRolesAssigned(lunit)) - local rrole = RoleValue(UnitGroupRolesAssigned(runit)) + local lrole = RoleValue(lhs:GetRole()) + local rrole = RoleValue(rhs:GetRole()) if lrole ~= rrole then return lrole < rrole