From 00aa1b253885aa4b27506ce35341e40e8513ef21 Mon Sep 17 00:00:00 2001 From: Vollmer Date: Wed, 25 Sep 2024 14:36:28 +0200 Subject: [PATCH] [Bugfix] Fix nil error for Shield Bar --- Widgets/Bars/ShieldBar.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Widgets/Bars/ShieldBar.lua b/Widgets/Bars/ShieldBar.lua index a9b30e7..4e28a7a 100644 --- a/Widgets/Bars/ShieldBar.lua +++ b/Widgets/Bars/ShieldBar.lua @@ -134,7 +134,12 @@ local function ShieldBar_SetValue(bar, percent) local barWidth = maxWidth * percent if bar.currentPoint == "healthBar" then - local ratio = 1 - bar._owner.states.healthPercent + local healthPercent = bar._owner.states.healthPercent + if not healthPercent then + local unit = bar._owner.states.unit + healthPercent = UnitHealth(unit) / UnitHealthMax(unit) + end + local ratio = 1 - healthPercent if percent > ratio then if bar.reverseFill then