Skip to content

Commit

Permalink
Fix error when converting a Combat Log trigger to Spell Cooldown trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbuds authored and InfusOnWoW committed Nov 21, 2024
1 parent 3c7f983 commit ce3bb32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions WeakAuras/Prototypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2249,6 +2249,7 @@ Private.event_categories = {
}

local GetNameAndIconForSpellName = function(trigger)
if type(trigger.spellName) == "table" then return end
local effectiveSpellId = Private.ExecEnv.GetEffectiveSpellId(trigger.spellName, trigger.use_exact_spellName, not trigger.use_ignoreoverride)
local name, _, icon = Private.ExecEnv.GetSpellInfo(effectiveSpellId)
return name, icon
Expand Down
7 changes: 5 additions & 2 deletions WeakAurasOptions/LoadOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum
hidden = disabled or hidden,
image = function()
local value = getValue(trigger, "use_"..realname, realname, multiEntry, entryNumber)
if value then
if type(value) == "number" or type(value) == "string" then
if(arg.type == "aura") then
local icon = spellCache.GetIcon(value);
return icon and tostring(icon) or "", 18, 18;
Expand All @@ -677,6 +677,9 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum
end,
disabled = function()
local value = getValue(trigger, nil, realname, multiEntry, entryNumber)
if type(value) ~= "number" and type(value) ~= "string" then
return true
end
return not ((arg.type == "aura" and value and spellCache.GetIcon(value)) or (arg.type == "spell" and value and OptionsPrivate.Private.ExecEnv.GetSpellName(value)) or (arg.type == "item" and value and C_Item.GetItemIconByID(value or '')))
end
};
Expand Down Expand Up @@ -714,7 +717,7 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum
end
elseif(arg.type == "spell") then
local useExactSpellId = (arg.showExactOption and getValue(trigger, nil, "use_exact_"..realname, multiEntry, entryNumber))
if value and value ~= "" then
if value and value ~= "" and type(value) == "number" or type(value) == "string" then
local spellID = WeakAuras.SafeToNumber(value)
if spellID then
if arg.negativeIsEJ and WeakAuras.IsRetail() and spellID < 0 then
Expand Down

0 comments on commit ce3bb32

Please sign in to comment.