target: fix nil color error

This commit is contained in:
shagu
2016-10-17 19:09:55 +02:00
parent 3e8235a156
commit 589536af5c
+1 -2
View File
@@ -87,14 +87,13 @@ pfUI:RegisterModule("target", function ()
pfUI.uf.target.hpText:SetText( hp)
end
local color
local color = { r = 1, g = 1, b = 1 }
if UnitIsPlayer("target") then
_, class = UnitClass("target")
color = RAID_CLASS_COLORS[class]
else
color = UnitReactionColor[UnitReaction("target", "player")]
end
if not color then color.r, color.g, color.b = 1, 1, 1 end
local r, g, b = (color.r + .5) * .5, (color.g + .5) * .5, (color.b + .5) * .5