Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Cata SpellInfo #287

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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