ColorGradient problem
Haleth opened this issue ยท 1 comments
Sorry for issue spam x) getting a lot of errors from this line in my health update function since the updates to colours:
self.Healthdef:SetVertexColor(self.ColorGradient(min / max, unpack(self.colors.smooth)))
Message: Interface\AddOns\FreeUI\oUF\colors.lua:65: attempt to perform arithmetic on local 'b2' (a nil value)
Time: Sun Oct 2 14:31:24 2011
Count: 271
Stack: Interface\AddOns\FreeUI\oUF\colors.lua:65: in function `ColorGradient'
Interface\AddOns\FreeUI\scripts\unitframes.lua:167: in function <Interface\AddOns\FreeUI\scripts\unitframes.lua:126>
(tail call): ?
(tail call): ?
(tail call): ?
Interface\AddOns\FreeUI\oUF\events.lua:74: in function <Interface\AddOns\FreeUI\oUF\events.lua:67>
Locals: a = 0.84675035968607
b = 1
perc = 0.84675035968607
num = 2.6666666666667
segment = 1
relperc = 0.41125059947679
r1 = 1
g1 = 0
b1 = 0
r2 = 1
g2 = 0
b2 = nil
(_temporary) = 1
(_temporary) = 0
(_temporary) = 1
(_temporary) = "attempt to perform arithmetic on local 'b2' (a nil value)"
Issue spam > no issues, so I'd rather have a ton of non-issues being reported than none at all ^^.
Anyway, the arguments to ColorGradient has changed.
In 1.5: ColorGradient(prec, ...)
in 1.6: ColorGradient(dividend, divisor, ...)
The main reason for this is to handle checking of division by zero in a central place, now that WoW 4.3 has FPE enabled. All you have to do is update your function call.