From eeba6c023520494609d327474be8454d94628bb7 Mon Sep 17 00:00:00 2001 From: Scott King Date: Tue, 7 Jan 2014 20:52:11 -0700 Subject: [PATCH] Calculation change Switched to math.ceil for better precision on execute abilities --- PortraitHealth.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PortraitHealth.lua b/PortraitHealth.lua index 57d78ed..b2d5f55 100644 --- a/PortraitHealth.lua +++ b/PortraitHealth.lua @@ -1,10 +1,10 @@ function HealthPercentage() -- health value to display. whole numbers only. - local TargetPercentHealth = math.floor((UnitHealth("target") / UnitHealthMax("target") * 100)); + local TargetPercentHealth = math.ceil((UnitHealth("target") / UnitHealthMax("target") * 100)); -- recolor text at 35% (future idea: class detection) - if TargetPercentHealth <= 35 then + if TargetPercentHealth < 35 then PortraitHealth_Health:SetTextColor(1,0,0); else PortraitHealth_Health:SetTextColor(1,1,0); -- 1.7.9.5