- added tons of divide-by-zero protection all over the place

- general cleanup of values passed to UpdateBar
This commit is contained in:
Parnic
2009-04-18 21:07:42 +00:00
parent f11192bfd1
commit 10af4566d6
16 changed files with 24 additions and 19 deletions

View File

@ -203,11 +203,11 @@ function IceUnitBar.prototype:Update()
self.health = UnitHealth(self.unit)
self.maxHealth = UnitHealthMax(self.unit)
self.healthPercentage = self.health/self.maxHealth
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.mana/self.maxMana
self.manaPercentage = self.maxMana > 0 and (self.mana/self.maxMana) or 0
_, self.unitClass = UnitClass(self.unit)