From 7389c241a476e03107e5a58f92eba16c2c08ef0c Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat, 11 Jul 2026 09:47:46 -0500 Subject: [PATCH] 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 --- libs/libpredict.lua | 3 ++- libs/libtotem.lua | 7 ++++--- modules/swingtimer.lua | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/libpredict.lua b/libs/libpredict.lua index 98af4d37..7f42c96f 100644 --- a/libs/libpredict.lua +++ b/libs/libpredict.lua @@ -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 diff --git a/libs/libtotem.lua b/libs/libtotem.lua index 4652e40e..5e1b87e8 100644 --- a/libs/libtotem.lua +++ b/libs/libtotem.lua @@ -228,8 +228,8 @@ pfUI.libdebuff_spell_go_hooks["libtotem"] = function(spellId) -- use pending name/icon if available (set by CastSpellByName hook), else GetSpellInfo local name = active[slot].pending_name local icon = active[slot].pending_icon - if not name and GetSpellInfo then - name = GetSpellInfo(spellId) + if not name then + name = C_Spell.GetSpellName(spellId) end active[slot].name = name active[slot].duration = data.duration @@ -265,7 +265,8 @@ hooksecurefunc("UseAction", function(slot, target, selfcast) local name, rank, spellID if kind == "spell" then spellID = id - name, rank = GetSpellInfo(id) + local spellInfo = C_Spell.GetSpellInfo(id) + name, rank = spellInfo.name, spellInfo.rank elseif kind == "macro" then name, rank, spellID = GetMacroSpell(id) end diff --git a/modules/swingtimer.lua b/modules/swingtimer.lua index acd289ae..d8de75b4 100644 --- a/modules/swingtimer.lua +++ b/modules/swingtimer.lua @@ -430,7 +430,7 @@ pfUI:RegisterModule("swingtimer", function () local kind, id = GetActionInfo(slot) local name if kind == "spell" then - name = GetSpellInfo(id) + name = C_Spell.GetSpellName(id) elseif kind == "macro" then name = GetMacroSpell(id) end