Fixed Destruction Warlocks freezing on login in pre-7.0 (ticket #207)

Destruction Warlocks have a PowerMax of 1000 and apparently trying to create that many graphical frames blows something up really quick. In 7.0, everyone's runes are discrete objects, so I was trying to ensure that the graphical representations of a given power were ready at all times, but didn't consider the pre-7.0 case where this calculation would lead to an absurd number of "runes".
This change also fixes an errant CreateFrame() in UpdateRunePower() that was supposed to be self:CreateFrame(). CreateFrame() was just creating a nameless, parentless frame for no reason at all. Good job, me. This isn't C++.
This commit is contained in:
Parnic
2016-05-29 14:21:50 -05:00
parent d05c1dac18
commit debaf7f1ff

View File

@ -419,7 +419,9 @@ end
function IceClassPowerCounter.prototype:Enable(core)
IceClassPowerCounter.super.prototype.Enable(self, core)
self.numRunes = UnitPowerMax(self.unit, self.unitPower)
if IceHUD.WowVer >= 70000 then
self.numRunes = UnitPowerMax(self.unit, self.unitPower)
end
self:CreateFrame()
self:CheckValidLevel(nil, UnitLevel("player"))
@ -487,10 +489,12 @@ function IceClassPowerCounter.prototype:UpdateRunePower(event, arg1, arg2)
return
end
local numMax = UnitPowerMax(self.unit, self.unitPower)
if numMax ~= self.numRunes then
self.numRunes = numMax
CreateFrame()
if IceHUD.WowVer >= 70000 then
local numMax = UnitPowerMax(self.unit, self.unitPower)
if numMax ~= self.numRunes then
self.numRunes = numMax
self:CreateFrame()
end
end
local numReady = UnitPower("player", self.unitPower)