Skip to content

Commit

Permalink
Fix error with talent tree
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbuds committed Oct 26, 2022
1 parent a74957d commit 8e4c42d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
6 changes: 3 additions & 3 deletions WeakAuras/Prototypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ Private.load_prototype = {
end,
multiConvertKey = WeakAuras.IsDragonflight() and function(trigger, key)
local specId = Private.checkForSingleLoadCondition(trigger, "class_and_spec")
if specId and type(Private.talentInfo[specId]) == "table" then
if specId and type(Private.talentInfo[specId]) == "table" and Private.talentInfo[specId][key] then
return Private.talentInfo[specId][key][2]
end
end or nil,
Expand Down Expand Up @@ -1374,7 +1374,7 @@ Private.load_prototype = {
end,
multiConvertKey = WeakAuras.IsDragonflight() and function(trigger, key)
local specId = Private.checkForSingleLoadCondition(trigger, "class_and_spec")
if specId and type(Private.talentInfo[specId]) == "table" then
if specId and type(Private.talentInfo[specId]) == "table" and Private.talentInfo[specId][key] then
return Private.talentInfo[specId][key][2]
end
end or nil,
Expand Down Expand Up @@ -1436,7 +1436,7 @@ Private.load_prototype = {
end,
multiConvertKey = WeakAuras.IsDragonflight() and function(trigger, key)
local specId = Private.checkForSingleLoadCondition(trigger, "class_and_spec")
if specId and type(Private.talentInfo[specId]) == "table" then
if specId and type(Private.talentInfo[specId]) == "table" and Private.talentInfo[specId][key] then
return Private.talentInfo[specId][key][2]
end
end or nil,
Expand Down
34 changes: 19 additions & 15 deletions WeakAurasOptions/LoadOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -815,28 +815,32 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum
if arg.multiConvertKey then
v = arg.multiConvertKey(trigger, v)
end
return trigger[realname].multi[v];
if v then
return trigger[realname].multi[v];
end
end
end,
set = function(info, v, calledFromSetAll)
if arg.multiConvertKey then
v = arg.multiConvertKey(trigger, v)
end
trigger[realname].multi = trigger[realname].multi or {};
if (calledFromSetAll or arg.multiTristate) then
trigger[realname].multi[v] = calledFromSetAll;
elseif(trigger[realname].multi[v]) then
trigger[realname].multi[v] = nil;
else
trigger[realname].multi[v] = true;
end
WeakAuras.Add(data);
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
if v then
trigger[realname].multi = trigger[realname].multi or {};
if (calledFromSetAll or arg.multiTristate) then
trigger[realname].multi[v] = calledFromSetAll;
elseif(trigger[realname].multi[v]) then
trigger[realname].multi[v] = nil;
else
trigger[realname].multi[v] = true;
end
WeakAuras.Add(data);
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
OptionsPrivate.SortDisplayButtons(nil, true);
end
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
OptionsPrivate.SortDisplayButtons(nil, true);
end
};
if(arg.required and not triggertype) then
Expand Down

0 comments on commit 8e4c42d

Please sign in to comment.