Fixed the MobHealth3 support I broke

This commit is contained in:
iceroth
2006-08-26 17:11:34 +00:00
parent f8e221b3fc
commit 6a143549dd

View File

@ -98,7 +98,10 @@ function TargetHealth.prototype:Update(unit)
self:SetBottomText1(self.healthPercentage)
if (self.moduleSettings.mobhealth and MobHealth3) then
-- assumption that if a unit's max health is 100, it's not actual amount
-- but rather a percentage - this obviously has one caveat though
if (self.maxHealth == 100 and self.moduleSettings.mobhealth and MobHealth3) then
self.health, self.maxHealth, _ = MobHealth3:GetUnitHealth(self.unit, self.health, self.maxHealth)
self.health = self:Round(self.health)
@ -106,9 +109,6 @@ function TargetHealth.prototype:Update(unit)
end
-- assumption that if a unit's max health is 100, it's not actual amount
-- but rather a percentage - this obviously has one caveat though
if (self.maxHealth ~= 100) then
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), self.color)
else
@ -124,6 +124,7 @@ function TargetHealth.prototype:Round(health)
if (health > 1000) then
return self:MathRound(health/1000, 1) .. "k"
end
return health
end