Skip to content

Commit

Permalink
Fix remaining time condition with modRate < 1
Browse files Browse the repository at this point in the history
If modRate is > 1 (time is slow down) checks at L151, L377 & L383 may skip the reschedule
  • Loading branch information
mrbuds authored and InfusOnWoW committed Sep 29, 2023
1 parent 491e75a commit 2a39ef6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions WeakAuras/Conditions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,15 @@ local function CreateTestForCondition(uid, input, allConditionsTemplate, usedSta
-- If adding a new condition type, don't forget to adjust the validator in the options code

if (cType == "timer" and value) then
recheckCode = " nextTime = state[" .. trigger .. "] and not state[" .. trigger .. "].paused"
.. " and state[" .. trigger .. "]" .. string.format("[%q]", variable)
.. " and (state[" .. trigger .. "]" .. string.format("[%q]", variable) .. " - " .. value .. ")\n"
if useModRate then
recheckCode = " nextTime = state[" .. trigger .. "] and not state[" .. trigger .. "].paused"
.. " and state[" .. trigger .. "]" .. string.format("[%q]", variable)
.. " and (state[" .. trigger .. "]" .. string.format("[%q]", variable) .. " - " .. value .. " * (state[" .. trigger .. "].modRate or 1.0))\n"
else
recheckCode = " nextTime = state[" .. trigger .. "] and not state[" .. trigger .. "].paused"
.. " and state[" .. trigger .. "]" .. string.format("[%q]", variable)
.. " and (state[" .. trigger .. "]" .. string.format("[%q]", variable) .. " - " .. value .. ")\n"
end
recheckCode = recheckCode .. " if (nextTime and (not recheckTime or nextTime < recheckTime) and nextTime >= now) then\n"
recheckCode = recheckCode .. " recheckTime = nextTime\n";
recheckCode = recheckCode .. " end\n"
Expand Down

0 comments on commit 2a39ef6

Please sign in to comment.