Skip to content

Commit

Permalink
Merge pull request #287 from Bestride/develop
Browse files Browse the repository at this point in the history
Fix Cata SpellInfo
  • Loading branch information
DanSheps authored Aug 18, 2024
2 parents dabaa26 + 7910dfe commit b6131a8
Showing 1 changed file with 28 additions and 14 deletions.
42 changes: 28 additions & 14 deletions Versions/Mainline/bestride.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b6131a8

Please sign in to comment.