Skip to content

Commit

Permalink
fix: #2205 additional attempts at fixing rare monk actionbar issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Aug 31, 2024
1 parent 008602d commit 7f2f80f
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions Components/Core/Common/Actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,40 @@ local function UpdateActionSlots()
-- but I can just imagine people with weird @focus macros
-- wondering why their icon doesn't update sometimes.

-- https://github.com/ascott18/TellMeWhen/issues/2198
-- Sometimes, FindBaseSpellByID can return `nil`. Fall back to `id` if it does.
local baseId = FindBaseSpellByID(id) or id;

local normalName = strlowerCache[(GetSpellName(id))]
local baseName = strlowerCache[(GetSpellName(baseId))]

MapSpellToAction(id, action)
MapSpellToAction(baseId, action)
MapSpellToAction(normalName, action)
MapSpellToAction(baseName, action)

local spells = {
[id] = true,
[baseId] = true,
[normalName] = true,
[baseName] = true,
}

local normalName = strlowerCache[GetSpellName(id)]
if normalName then
spells[normalName] = true
MapSpellToAction(normalName, action)
end

-- https://github.com/ascott18/TellMeWhen/issues/2198
-- Sometimes, FindBaseSpellByID can return `nil`.
local baseId = FindBaseSpellByID(id);
if baseId then
local baseName = strlowerCache[GetSpellName(baseId)]
spells[baseId] = true
spells[baseName] = true
MapSpellToAction(baseId, action)
MapSpellToAction(baseName, action)
end

if C_Spell.GetOverrideSpell then

-- https://github.com/ascott18/TellMeWhen/issues/2205
-- I suspect GetOverrideSpell was returning nil too?
local overrideId = C_Spell.GetOverrideSpell(id);
local overrideName = strlowerCache[(GetSpellName(overrideId))]
MapSpellToAction(overrideId, action)
MapSpellToAction(overrideName, action)
spells[overrideId] = true
spells[overrideName] = true
if overrideId then
local overrideName = strlowerCache[GetSpellName(overrideId)]
MapSpellToAction(overrideId, action)
MapSpellToAction(overrideName, action)
spells[overrideId] = true
spells[overrideName] = true
end
end

ActionToSpells[action] = spells
Expand Down

0 comments on commit 7f2f80f

Please sign in to comment.