Skip to content

Commit

Permalink
Cooldown Progress (Spell), Cooldown Ready: Change spell id logic
Browse files Browse the repository at this point in the history
Change how the "non-exact spell match" logic work to make it work better
with the APIs that TWW provides.

The intent of the "non-exact spell match" option is to get the cooldown
information as long as the "name" matches.

That relied on the game giving us information on
GetSpellCooldown("name") for the right spell.

Before TWW this worked reasonably well, although a few spells were not
following overrides.

In TWW, C_Spell.GetSpellCooldown() never follows overrides and thus in a
lot more cases asking for the spell cooldown via the name doesn't work.

Thus we now do the following algorithm (with ample pseudo functions):

local spellId = ...
if not exactMatch then
  spellId = GetSpellId(GetSpellName(spellId))
end
if followoverride then
  spellId = GetSpellOverride(spellId)
end

cooldownInfo = GetSpellCooldown(spellId)

And while at it refactor some of the internals so that the code has
complexity.

Fixes: #5246
  • Loading branch information
InfusOnWoW committed Jul 30, 2024
1 parent 05f7fd7 commit f3a839c
Show file tree
Hide file tree
Showing 2 changed files with 413 additions and 427 deletions.
Loading

0 comments on commit f3a839c

Please sign in to comment.