- Possibly fixed some NaN/divide-by-zero errors that have been cropping up sporadically lately.

This commit is contained in:
Parnic
2013-12-23 06:03:37 +00:00
parent b3897f279e
commit c66aea12cc
2 changed files with 2 additions and 2 deletions

View File

@ -1216,7 +1216,7 @@ function PlayerHealth.prototype:Update(unit)
local percent
if incomingHealAmt > 0 then
percent = ((self.health + incomingHealAmt) / self.maxHealth)
percent = self.maxHealth ~= 0 and ((self.health + incomingHealAmt) / self.maxHealth) or 0
if self.moduleSettings.reverse then
percent = 1 - percent
-- Rokiyo: I'm thinking the frama strata should also to be set to medium if we're in reverse.

View File

@ -539,7 +539,7 @@ function TargetOfTarget.prototype:Update()
if not IceHUD.IceCore:ShouldUseDogTags() then
local name = UnitName(self.unit)
local healthPercentage = math.floor( (health/maxHealth)*100 )
local healthPercentage = maxHealth ~= 0 and math.floor( (health/maxHealth)*100 ) or 0
self.frame.totName:SetTextColor(1,1,1, 0.9)
self.frame.totHealth:SetTextColor(1,1,1, 0.9)