- fixed divide-by-zero causing a crash on the PTR (this *really* shouldn't cause a crash since it's UI script, but it would appear that the engine is not check for div-by-0 on the PTR. this could potentially happen in a lot of other places...)

This commit is contained in:
Parnic
2009-03-02 04:45:27 +00:00
parent 8605f8de89
commit d5759d7a98
2 changed files with 6 additions and 3 deletions

View File

@ -109,8 +109,9 @@ function PetHealth.prototype:Update(unit)
color = "Dead"
end
self:UpdateBar(self.health/self.maxHealth, color)
if (self.maxHealth > 0) then
self:UpdateBar(self.health/self.maxHealth, color)
end
if not IceHUD.IceCore:ShouldUseDogTags() then
self:SetBottomText1(math.floor(self.healthPercentage * 100))