View Single Post
Unread 04-27-09, 09:54 PM   #1010
arnath_vp
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 9
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.

Last edited by arnath_vp : 04-28-09 at 02:50 PM.
arnath_vp is offline