Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

power: Store and forward the used minimum value correctly #695

Merged
merged 2 commits into from
Nov 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion elements/power.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ local function Update(self, event, unit)
end

local cur, max = UnitPower(unit, displayType), UnitPowerMax(unit, displayType)
element:SetMinMaxValues(min or 0, max)
min = min or 0 -- ensure we always have a minimum value to avoid errors
element:SetMinMaxValues(min, max)

if(UnitIsConnected(unit)) then
element:SetValue(cur)
Expand Down