Skip to content

Commit

Permalink
For tracking a specific charge, don't use static progress
Browse files Browse the repository at this point in the history
  • Loading branch information
InfusOnWoW committed Mar 20, 2024
1 parent e9b714e commit 9643530
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions WeakAuras/Prototypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4833,21 +4833,7 @@ Private.event_prototypes = {
else -- Tracking charges
local ret2 = [=[
local trackedCharge = %s
if (charges < trackedCharge) then
if (state.value ~= duration) then
state.value = duration;
state.changed = true;
end
if (state.total ~= duration) then
state.total = duration;
state.changed = true;
end
state.expirationTime = nil;
state.duration = nil;
state.modRate = nil
state.progressType = 'static';
elseif (charges > trackedCharge) then
if (charges > trackedCharge) then
if (state.expirationTime ~= 0) then
state.expirationTime = 0;
state.changed = true;
Expand All @@ -4861,6 +4847,9 @@ Private.event_prototypes = {
state.total = nil;
state.progressType = 'timed';
else
if duration then
expirationTime = expirationTime + (trackedCharge - charges) * duration
end
if (state.expirationTime ~= expirationTime) then
state.expirationTime = expirationTime;
state.changed = true;
Expand Down

0 comments on commit 9643530

Please sign in to comment.