From ed0a9917de0c3d5138c0719a22ef857f7c5b5f06 Mon Sep 17 00:00:00 2001 From: shagu Date: Tue, 24 Aug 2021 19:00:27 +0200 Subject: [PATCH] health-numbers: only update unit texts --- mods/health-numbers.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/health-numbers.lua b/mods/health-numbers.lua index a9982ba..f47a6fa 100644 --- a/mods/health-numbers.lua +++ b/mods/health-numbers.lua @@ -49,12 +49,13 @@ module.enable = function(self) local HookTextStatusBar_UpdateTextString = TextStatusBar_UpdateTextString function TextStatusBar_UpdateTextString(sb) if not sb then sb = this end - sb.lockShow = 1 HookTextStatusBar_UpdateTextString(sb) local string = sb.TextString - if string then + if string and sb.unit then + sb.lockShow = 1 + local min, max = sb:GetMinMaxValues() local cur = sb:GetValue() local percent = max > 0 and floor(cur/max*100) or 0