From 6a143549dd5113ad637f63469b36d0e559bad471 Mon Sep 17 00:00:00 2001 From: iceroth Date: Sat, 26 Aug 2006 17:11:34 +0000 Subject: [PATCH] Fixed the MobHealth3 support I broke --- modules/TargetHealth.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/TargetHealth.lua b/modules/TargetHealth.lua index 531553e..364187e 100644 --- a/modules/TargetHealth.lua +++ b/modules/TargetHealth.lua @@ -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