From f3561dbe12a7e0a475caca0ab5312803cd3900c2 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 3 May 2020 14:09:56 +0200 Subject: [PATCH] tooltip: detect server sent values below 100 --- modules/tooltip.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tooltip.lua b/modules/tooltip.lua index ed649a39..ef69aa54 100644 --- a/modules/tooltip.lua +++ b/modules/tooltip.lua @@ -135,7 +135,7 @@ pfUI:RegisterModule("tooltip", "vanilla:tbc", function () local _, hpmax = GameTooltipStatusBar:GetMinMaxValues() local rhp, rhpmax, estimated - if hpmax > 100 then + if hpmax > 100 or (round(hpmax/100*hp) ~= hp) then rhp, rhpmax = hp, hpmax elseif pfUI.libhealth and pfUI.libhealth.enabled then rhp, rhpmax, estimated = pfUI.libhealth:GetUnitHealthByName(this.name, this.level, tonumber(hp), tonumber(hpmax)) @@ -149,7 +149,7 @@ pfUI:RegisterModule("tooltip", "vanilla:tbc", function () end end - if C.tooltip.alwaysperc == "0" and ( estimated or hpmax > 100 ) then + if C.tooltip.alwaysperc == "0" and ( estimated or hpmax > 100 or (round(hpmax/100*hp) ~= hp) ) then pfUI.tooltipStatusBar.HP:SetText(string.format("%s / %s", Abbreviate(rhp), Abbreviate(rhpmax))) else pfUI.tooltipStatusBar.HP:SetText(string.format("%s%%", hp))