Skip to content

Commit

Permalink
[Bugfix] Fix nil error for Shield Bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Krealle committed Sep 25, 2024
1 parent a849613 commit 00aa1b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Widgets/Bars/ShieldBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00aa1b2

Please sign in to comment.