Skip to content

Commit 86199aa

Browse files
InfusOnWoWStanzilla
authored andcommitted
Fix stacks condition for Cooldown Progress (Spell)
1 parent e76aed1 commit 86199aa

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

WeakAuras/WeakAuras.lua

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local internalVersion = 3;
1+
local internalVersion = 4;
22

33
-- Lua APIs
44
local tinsert, tconcat, tremove, tContains, wipe = table.insert, table.concat, table.remove, tContains, wipe
@@ -2302,9 +2302,31 @@ function WeakAuras.Modernize(data)
23022302
data.yOffset = 0;
23032303
end
23042304
end
2305-
23062305
end
23072306

2307+
-- Version 4 was introduced July 2018 in BfA
2308+
if (data.internalVersion < 4) then
2309+
if (data.conditions) then
2310+
for conditionIndex, condition in ipairs(data.conditions) do
2311+
if (condition.check) then
2312+
local triggernum = condition.check.trigger;
2313+
if (triggernum) then
2314+
local trigger;
2315+
if (triggernum == 0) then
2316+
trigger = data.trigger;
2317+
elseif(data.additional_triggers and data.additional_triggers[triggernum]) then
2318+
trigger = data.additional_triggers[triggernum].trigger;
2319+
end
2320+
if (trigger and trigger.event == "Cooldown Progress (Spell)") then
2321+
if (condition.check.variable == "stacks") then
2322+
condition.check.variable = "charges";
2323+
end
2324+
end
2325+
end
2326+
end
2327+
end
2328+
end
2329+
end
23082330

23092331
for _, triggerSystem in pairs(triggerSystems) do
23102332
triggerSystem.Modernize(data);

0 commit comments

Comments
 (0)