Skip to content

Commit

Permalink
fix: #2212 font of magic + fire breath Blizzard bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Sep 2, 2024
1 parent a04d065 commit a94efef
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion Components/Core/Spells/Spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,22 @@ local function parseSpellsString(setting, doLower, keepDurations)
end
parseSpellsString = TMW:MakeNArgFunctionCached(3, parseSpellsString)

-- IDs of spells that can't be tracked properly because of blizzard bugs.
local fixSpellMap = {
[382266] = function()
-- Evoker https://github.com/ascott18/TellMeWhen/issues/2212
-- Fire Breath + font of magic
if
not IsPlayerSpell(382266) -- The fire breath ID reported by blizzard is actually unlearned
and not IsPlayerSpell(408083) -- Font of magic (augmentation) talent unlearned
and not IsPlayerSpell(411212) -- Font of magic (devastation) talent unlearned
and not IsPlayerSpell(375783) -- Font of magic (preservation) talent unlearned
then
return 357208 -- Fire breath without font of magic
end
end,
}

local function getSpellNames(setting, doLower, firstOnly, convert, hash, allowRenaming)
local spells = parseSpellsString(setting, doLower, false)

Expand All @@ -166,7 +182,18 @@ local function getSpellNames(setting, doLower, firstOnly, convert, hash, allowRe
if C_Spell and C_Spell.GetOverrideSpell then
local spellID = C_Spell.GetOverrideSpell(v or "")
if spellID and spellID ~= 0 then
spells[k] = spellID
if fixSpellMap[spellID] then
-- Attempt to fix blizzard bugs like https://github.com/Stanzilla/WoWUIBugs/issues/354
local newSpell = fixSpellMap[spellID]()
if newSpell then
print("fixing bugged spell", v, spellID, "=>", newSpell)
spells[k] = newSpell
else
spells[k] = spellID
end
else
spells[k] = spellID
end
end
end
end
Expand Down

0 comments on commit a94efef

Please sign in to comment.