Fixed "divide by zero" errors that could happen in class power counters when switching specs.

This commit is contained in:
Parnic
2014-10-25 22:42:47 -05:00
parent 07ff89e8f8
commit bfcf8de7b4

View File

@ -771,7 +771,7 @@ end
function IceClassPowerCounter.prototype:GetGradientColor(curr)
local r, g, b = self:GetCustomColor()
local mr, mg, mb = self:GetCustomMinColor()
local scale = (curr-1)/(self.numRunes-1)
local scale = self.numRunes == 1 and 0 or ((curr-1)/(self.numRunes-1))
if r < mr then
r = ((r-mr)*scale) + mr