- updated all UnitPower* code to use the SPELL_POWER_* constants instead of hardcoding numbers...mostly just a readability change

This commit is contained in:
Parnic
2010-09-10 01:50:43 +00:00
parent 22fd66d756
commit 8d4686f10c
7 changed files with 27 additions and 55 deletions

View File

@ -5,6 +5,7 @@ local DruidMana = AceOO.Class(IceUnitBar)
DruidMana.prototype.druidMana = nil
DruidMana.prototype.druidManaMax = nil
local MANA_POWER_INDEX = SPELL_POWER_MANA
-- Constructor --
function DruidMana.prototype:init()
@ -54,8 +55,8 @@ function DruidMana.prototype:Update()
local forms = (UnitPowerType(self.unit) ~= 0)
self.druidMana = UnitPower(self.unit, 0)
self.druidManaMax = UnitPowerMax(self.unit, 0)
self.druidMana = UnitPower(self.unit, MANA_POWER_INDEX)
self.druidManaMax = UnitPowerMax(self.unit, MANA_POWER_INDEX)
if (not self.alive or not forms or not self.druidMana or not self.druidManaMax or self.druidManaMax == 0) then
self:Show(false)