From 7910dfe720bec5931bb71b3b67741f49010bae8f Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Sat, 17 Aug 2024 20:01:16 -0500 Subject: [PATCH] Fix Cata SpellInfo --- Versions/Mainline/bestride.lua | 42 ++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/Versions/Mainline/bestride.lua b/Versions/Mainline/bestride.lua index 999decd..d1eae85 100644 --- a/Versions/Mainline/bestride.lua +++ b/Versions/Mainline/bestride.lua @@ -34,23 +34,37 @@ function BeStride:IsSpellUsable(spell) end function BeStride:GetSpellInfo(spell) - local info = C_Spell.GetSpellInfo(spell) - if info and type(info) == "table" then - return { name = info.name, spellID = info.spellID } - else - local name,_,_,_,_,_,spellID = C_Spell.GetSpellInfo(spell) - return { name = name, spellID = spellID } - end + if C_Spell.GetSpellInfo then + local info = C_Spell.GetSpellInfo(spell) + if info and type(info) == "table" then + return { name = info.name, spellID = info.spellID } + else + local name,_,_,_,_,_,spellID = C_Spell.GetSpellInfo(spell) + return { name = name, spellID = spellID } + end + elseif GetSpellInfo then + local name,_,_,_,_,_,spellID = GetSpellInfo(spell) + return { name = name, spellID = spellID } + else + return nil + end end function BeStride:GetSpellOnCooldown(spell) - local info = C_Spell.GetSpellCooldown(spell) - if info and type(info) == "table" then - return info.duration ~= 0 - else - local onCooldown, _, _, _ = GetSpellCooldown(195072) - return onCooldown ~= 0 - end + if C_Spell.GetSpellCooldown then + local info = C_Spell.GetSpellCooldown(spell) + if info and type(info) == "table" then + return info.duration ~= 0 + else + local onCooldown, _, _, _ = GetSpellCooldown(195072) + return onCooldown ~= 0 + end + elseif GetSpellCooldown then + local onCooldown, _, _, _ = GetSpellCooldown(195072) + return onCooldown ~= 0 + else + return nil + end end function BeStride:GetMountInfoByMountID(id)