Skip to content

Commit

Permalink
Fix to ensure spell exists before adding to WarningDebuffs table
Browse files Browse the repository at this point in the history
Fixes #712
  • Loading branch information
jordonwow committed May 3, 2024
1 parent 35ef0f0 commit d23e4eb
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,26 @@ if WOW_PROJECT_ID ~= WOW_PROJECT_CLASSIC then
for i = 1, #BigDebuffs.WarningDebuffs do
local id = BigDebuffs.WarningDebuffs[i]
local name = GetSpellInfo(id)
WarningDebuffs[name] = {
type = "toggle",
get = function(info) local key = info[#info-2] return BigDebuffs.db.profile[key].warningList[id] end,
set = function(info, value)
local key = info[#info-2]
BigDebuffs.db.profile[key].warningList[id] = value BigDebuffs:Refresh()
end,
name = name,
desc = function()
local s = Spell:CreateFromSpellID(id)
local spellDesc = s:GetSpellDescription() or ""
local extra =
"\n\n|cffffd700"..L["Spell ID"].."|r "..id..
"\n------------------\n"..
L["Show this debuff if present while BigDebuffs are displayed"]
return spellDesc..extra
end,
}
if name then
WarningDebuffs[name] = {
type = "toggle",
get = function(info) local key = info[#info-2] return BigDebuffs.db.profile[key].warningList[id] end,
set = function(info, value)
local key = info[#info-2]
BigDebuffs.db.profile[key].warningList[id] = value BigDebuffs:Refresh()
end,
name = name,
desc = function()
local s = Spell:CreateFromSpellID(id)
local spellDesc = s:GetSpellDescription() or ""
local extra =
"\n\n|cffffd700"..L["Spell ID"].."|r "..id..
"\n------------------\n"..
L["Show this debuff if present while BigDebuffs are displayed"]
return spellDesc..extra
end,
}
end
end
end

Expand Down

0 comments on commit d23e4eb

Please sign in to comment.