mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
Fixed the MobHealth3 support I broke
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user