From 8c61f1fbbbd446f88e43a0c6c00d23af7145093e Mon Sep 17 00:00:00 2001 From: shagu Date: Fri, 10 Dec 2021 15:02:23 +0100 Subject: [PATCH] nameplates: add support for mobhealth2 --- modules/nameplates.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/nameplates.lua b/modules/nameplates.lua index dd18faa1..3284236b 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -488,8 +488,10 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () -- remove unitstr on unit name mismatch if unitstr and UnitName(unitstr) ~= name then unitstr = nil end + -- use mobhealth values if addon is running if (MobHealth3 or MobHealthFrame) and target and name == UnitName('target') and MobHealth_GetTargetCurHP() then - hp, hpmax = MobHealth_GetTargetCurHP(), MobHealth_GetTargetMaxHP() + hp = MobHealth_GetTargetCurHP() > 0 and MobHealth_GetTargetCurHP() or hp + hpmax = MobHealth_GetTargetMaxHP() > 0 and MobHealth_GetTargetMaxHP() or hpmax end -- always make sure to keep plate visible