using GetSpellInfo with just a spell id is dangerous

Handful of addons will polyfill their own GetSpellInfo that only accept (bookSlot, bookType) so it's only safe to use C_Spell.GetSpellInfo with just a spell id
This commit is contained in:
Brues
2026-07-11 09:47:46 -05:00
parent fb5230828c
commit 7389c241a4
3 changed files with 7 additions and 5 deletions
+2 -1
View File
@@ -1020,7 +1020,8 @@ hooksecurefunc("UseAction", function(slot, target, selfcast)
local kind, id = GetActionInfo(slot)
local effect, rank
if kind == "spell" then
effect, rank = GetSpellInfo(id)
local spellInfo = C_Spell.GetSpellInfo(id)
effect, rank = spellInfo.name, spellInfo.rank
elseif kind == "macro" then
effect, rank = GetMacroSpell(id)
end