From f214c945af0022cd93f33d06254ea8e38fbebbd4 Mon Sep 17 00:00:00 2001 From: Parnic Date: Wed, 1 Jun 2016 00:11:33 -0500 Subject: [PATCH] Added second argument to UnitPower I keep seeing things online saying the one-argument version of UnitPower has been deprecated, so I figured I'd go ahead and update my few uses of it in case it actually gets removed at some point. I haven't had any trouble with it, though. --- IceUnitBar.lua | 4 ++-- modules/PlayerMana.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/IceUnitBar.lua b/IceUnitBar.lua index 6c0e76f..ef3e60c 100644 --- a/IceUnitBar.lua +++ b/IceUnitBar.lua @@ -223,8 +223,8 @@ function IceUnitBar.prototype:Update() self.maxHealth = UnitHealthMax(self.unit) self.healthPercentage = self.maxHealth ~= 0 and (self.health/self.maxHealth) or 0 - self.mana = UnitPower(self.unit) - self.maxMana = UnitPowerMax(self.unit) + self.mana = UnitPower(self.unit, UnitPowerType(self.unit)) + self.maxMana = UnitPowerMax(self.unit, UnitPowerType(self.unit)) self.manaPercentage = self.maxMana ~= 0 and (self.mana/self.maxMana) or 0 local locClass diff --git a/modules/PlayerMana.lua b/modules/PlayerMana.lua index bd38c31..cd5b10e 100644 --- a/modules/PlayerMana.lua +++ b/modules/PlayerMana.lua @@ -355,13 +355,13 @@ function PlayerMana.prototype:UpdateEnergy(event, unit) return end - self.previousEnergy = UnitPower(self.unit) + self.previousEnergy = UnitPower(self.unit, UnitPowerType(self.unit)) if IceHUD.WowVer < 40000 then self:Update(unit) end if self:ShouldUseTicker() and - ((not (self.previousEnergy) or (self.previousEnergy <= UnitPower(self.unit))) and + ((not (self.previousEnergy) or (self.previousEnergy <= UnitPower(self.unit, UnitPowerType(self.unit)))) and (self.moduleSettings.tickerEnabled) and self.manaType == SPELL_POWER_ENERGY) then self.tickStart = GetTime() self.tickerFrame:Show()