From 0a0a816701e2593cdd04a0635605ad08e843d29f Mon Sep 17 00:00:00 2001 From: Parnic Date: Sun, 19 Apr 2009 00:49:33 +0000 Subject: [PATCH] - more minor cleanups before tagging a new release version --- IceCastBar.lua | 4 ++-- IceUnitBar.lua | 4 ++-- modules/CustomBar.lua | 2 +- modules/DruidMana.lua | 2 +- modules/GlobalCoolDown.lua | 2 +- modules/HungerForBlood.lua | 4 ++-- modules/MirrorBar.lua | 2 +- modules/SliceAndDice.lua | 4 ++-- modules/TargetCC.lua | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/IceCastBar.lua b/IceCastBar.lua index b405e9a..c893a17 100644 --- a/IceCastBar.lua +++ b/IceCastBar.lua @@ -135,10 +135,10 @@ function IceCastBar.prototype:OnUpdate() -- handle casting and channeling if (self.action == IceCastBar.Actions.Cast or self.action == IceCastBar.Actions.Channel) then local remainingTime = self.actionStartTime + self.actionDuration - time - local scale = 1 - (self.actionDuration > 0 and remainingTime / self.actionDuration or 0) + local scale = 1 - (self.actionDuration ~= 0 and remainingTime / self.actionDuration or 0) if (self.action == IceCastBar.Actions.Channel) then - scale = self.actionDuration > 0 and remainingTime / self.actionDuration or 0 + scale = self.actionDuration ~= 0 and remainingTime / self.actionDuration or 0 end if (remainingTime < 0) then diff --git a/IceUnitBar.lua b/IceUnitBar.lua index 0369171..118b881 100644 --- a/IceUnitBar.lua +++ b/IceUnitBar.lua @@ -203,11 +203,11 @@ function IceUnitBar.prototype:Update() self.health = UnitHealth(self.unit) self.maxHealth = UnitHealthMax(self.unit) - self.healthPercentage = self.maxHealth > 0 and (self.health/self.maxHealth) or 0 + self.healthPercentage = self.maxHealth ~= 0 and (self.health/self.maxHealth) or 0 self.mana = UnitMana(self.unit) self.maxMana = UnitManaMax(self.unit) - self.manaPercentage = self.maxMana > 0 and (self.mana/self.maxMana) or 0 + self.manaPercentage = self.maxMana ~= 0 and (self.mana/self.maxMana) or 0 _, self.unitClass = UnitClass(self.unit) diff --git a/modules/CustomBar.lua b/modules/CustomBar.lua index c4df3b6..57cfde6 100644 --- a/modules/CustomBar.lua +++ b/modules/CustomBar.lua @@ -278,7 +278,7 @@ function IceCustomBar.prototype:UpdateCustomBar(unit, fromUpdate) remaining = self.auraEndTime - now end - self:UpdateBar(self.auraDuration > 0 and remaining / self.auraDuration or 0, "undef") + self:UpdateBar(self.auraDuration ~= 0 and remaining / self.auraDuration or 0, "undef") else self:UpdateBar(0, "undef") self:Show(false) diff --git a/modules/DruidMana.lua b/modules/DruidMana.lua index ff128cd..caa072e 100644 --- a/modules/DruidMana.lua +++ b/modules/DruidMana.lua @@ -59,7 +59,7 @@ function DruidMana.prototype:Update() self:Show(true) end - self:UpdateBar(self.druidManaMax > 0 and self.druidMana / self.druidManaMax or 0, "DruidMana") + self:UpdateBar(self.druidManaMax ~= 0 and self.druidMana / self.druidManaMax or 0, "DruidMana") end diff --git a/modules/GlobalCoolDown.lua b/modules/GlobalCoolDown.lua index d6d82f7..0e8a37b 100644 --- a/modules/GlobalCoolDown.lua +++ b/modules/GlobalCoolDown.lua @@ -161,7 +161,7 @@ function GlobalCoolDown.prototype:UpdateGlobalCoolDown() self:Show(false) else - self:UpdateBar(1 - (self.duration > 0 and remaining / self.duration or 0), "GlobalCoolDown", 0.8) + self:UpdateBar(1 - (self.duration ~= 0 and remaining / self.duration or 0), "GlobalCoolDown", 0.8) end else self:Show(false) diff --git a/modules/HungerForBlood.lua b/modules/HungerForBlood.lua index 3105ac4..9892d53 100644 --- a/modules/HungerForBlood.lua +++ b/modules/HungerForBlood.lua @@ -191,9 +191,9 @@ function HungerForBlood.prototype:UpdateHungerForBlood(unit, fromUpdate) remaining = hfbEndTime - now end if (hfbBuffCount ~= nil and hfbBuffCount > 2) then - self:UpdateBar(hfbDuration > 0 and remaining / hfbDuration or 0, "HungerForBloodMax") + self:UpdateBar(hfbDuration ~= 0 and remaining / hfbDuration or 0, "HungerForBloodMax") else - self:UpdateBar(hfbDuration > 0 and remaining / hfbDuration or 0, "HungerForBlood") + self:UpdateBar(hfbDuration ~= 0 and remaining / hfbDuration or 0, "HungerForBlood") end formatString = self.moduleSettings.upperText or '' diff --git a/modules/MirrorBar.lua b/modules/MirrorBar.lua index 6c5f450..39afdec 100644 --- a/modules/MirrorBar.lua +++ b/modules/MirrorBar.lua @@ -73,7 +73,7 @@ function MirrorBar.prototype:OnUpdate(elapsed) self.value = self.value + (self.timerScale * elapsed * 1000) - scale = self.maxValue > 0 and self.value / self.maxValue or 0 + scale = self.maxValue ~= 0 and self.value / self.maxValue or 0 if (scale < 0) then -- lag compensation scale = 0 diff --git a/modules/SliceAndDice.lua b/modules/SliceAndDice.lua index ec6ea8b..761ca41 100644 --- a/modules/SliceAndDice.lua +++ b/modules/SliceAndDice.lua @@ -225,8 +225,8 @@ function SliceAndDice.prototype:UpdateSliceAndDice(unit, fromUpdate) if not remaining then remaining = sndEndTime - now end - local denominator = (self.moduleSettings.showAsPercentOfMax and CurrMaxSnDDuration or sndDuration) - self:UpdateBar(denominator > 0 and remaining / denominator or 0, "SliceAndDice") + local denominator = (self.moduleSettings.showAsPercentOfMax and CurrMaxSnDDuration or sndDuration) + self:UpdateBar(denominator ~= 0 and remaining / denominator or 0, "SliceAndDice") formatString = self.moduleSettings.upperText or '' else diff --git a/modules/TargetCC.lua b/modules/TargetCC.lua index 1f40567..2eceade 100644 --- a/modules/TargetCC.lua +++ b/modules/TargetCC.lua @@ -294,7 +294,7 @@ function TargetCC.prototype:UpdateTargetDebuffs(unit, isUpdate) self:Show(true) if (duration ~= nil and duration > 0) then - self:UpdateBar(duration > 0 and remaining / duration or 0, "CC:" .. self.debuffList[name]) + self:UpdateBar(duration ~= 0 and remaining / duration or 0, "CC:" .. self.debuffList[name]) self:SetBottomText2(floor(remaining * 10) / 10) else self:UpdateBar(0, "CC:" .. self.debuffList[name])