I have a custom tag for name color that looks something like this (Hex is just the same RGB to Hex function used in tags.lua):
Code:
oUF.Tags["[customnamecolor]"] = function(unit)
if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
return Hex(oUF.colors.tapped)
elseif(not UnitIsConnected(unit)) then
return Hex(oUF.colors.disconnected)
elseif(UnitIsPlayer(unit)) then
local _, class = UnitClass(unit)
return Hex(oUF.colors.class[class])
else
return Hex(oUF.colors.reaction[UnitReaction(unit, "player")])
end
end
However, for some reason, when unit is a party member (e.g., "party1"), some of the time UnitClass returns nil. Anybody know why this happens and what I might be able to do to fix it?
EDIT: To update, this seems to have gone away in the latest version of oUF (released today I think) but I'm still confused as to why it was happening in the first place and would love some enlightenment.