Skip to content

Commit

Permalink
Move setting of db.displays a bit earlier
Browse files Browse the repository at this point in the history
As SetRegion might call the custom trigger functions, and that
requires ActivateAuraEnvironment, which looks for db.displays

Fixes a issue found while investigating:
Gihub-Issue: 633
  • Loading branch information
InfusOnWoW authored and Stanzilla committed Aug 12, 2018
1 parent 0832fbe commit 4143296
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion WeakAuras/WeakAuras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,7 @@ local function pAdd(data)
if not(id) then
error("Improper arguments to WeakAuras.Add - id not defined");
elseif (data.controlledChildren) then
db.displays[id] = data;
WeakAuras.SetRegion(data);
else
if (not data.activeTriggerMode or data.activeTriggerMode >= data.numTriggers) then
Expand Down Expand Up @@ -2729,6 +2730,8 @@ local function pAdd(data)
activatedConditions = {},
};

db.displays[id] = data;

local region = WeakAuras.SetRegion(data);
if (WeakAuras.clones[id]) then
for cloneId, _ in pairs(WeakAuras.clones[id]) do
Expand All @@ -2745,7 +2748,6 @@ local function pAdd(data)
end

removeSpellNames(data);
db.displays[id] = data;
end

-- Dummy add function to protect errors from propagating out of the real add function
Expand Down

0 comments on commit 4143296

Please sign in to comment.