From 97763d8db4e7710c6b756f2d5891db6e38e8b637 Mon Sep 17 00:00:00 2001 From: shagu Date: Wed, 24 Jun 2020 13:07:04 +0200 Subject: [PATCH] tooltip: remove caption on invalid health values --- modules/tooltip.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/tooltip.lua b/modules/tooltip.lua index b1e4b195..2f43b764 100644 --- a/modules/tooltip.lua +++ b/modules/tooltip.lua @@ -155,10 +155,12 @@ pfUI:RegisterModule("tooltip", "vanilla:tbc", function () end end - if C.tooltip.alwaysperc == "0" and ( estimated or hpmax > 100 or (round(hpmax/100*hp) ~= hp) ) 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 + elseif hpmax > 0 then pfUI.tooltipStatusBar.HP:SetText(string.format("%s%%", ceil(hp/hpmax*100))) + else + pfUI.tooltipStatusBar.HP:SetText("") end end)