mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-21 23:26:56 +00:00
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:
+2
-1
@@ -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
|
||||
|
||||
+4
-3
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user