Skip to content

Commit

Permalink
Merge pull request #828 from Flamanis/Change-C_Spell-and-C_UnitAuras-…
Browse files Browse the repository at this point in the history
…check

Change C_Spell and C_UnitAuras checks for TWW/Cata PTR
  • Loading branch information
Tercioo authored Sep 13, 2024
2 parents 05a5bb5 + 675e56d commit 3b26d0d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,30 +216,32 @@
local GetSpellInfo = C_Spell and C_Spell.GetSpellInfo or GetSpellInfo
Details222.GetSpellInfo = GetSpellInfo

local UnitBuff = UnitBuff or C_UnitAuras.GetBuffDataByIndex
local UnitBuff = C_UnitAuras and C_UnitAuras.GetBuffDataByIndex or UnitBuff
Details222.UnitBuff = UnitBuff

local UnitDebuff = UnitDebuff or C_UnitAuras.GetDebuffDataByIndex
local UnitDebuff = C_UnitAuras and C_UnitAuras.GetDebuffDataByIndex or UnitDebuff
Details222.UnitDebuff = UnitDebuff

if (DetailsFramework.IsWarWow()) then
if (C_Spell and C_Spell.GetSpellInfo) then
Details222.GetSpellInfo = function(...)
local result = GetSpellInfo(...)
if result then
return result.name, 1, result.iconID
end
end

end

if (C_UnitAuras and C_UnitAuras.GetAuraDataByIndex) then
Details222.UnitBuff = function(unitToken, index, filter)
local auraData = C_UnitAuras.GetBuffDataByIndex(unitToken, index, filter)
local auraData = UnitBuff(unitToken, index, filter)
if (not auraData) then
return nil
end
return AuraUtil.UnpackAuraData(auraData)
end

Details222.UnitDebuff = function(unitToken, index, filter)
local auraData = C_UnitAuras.GetDebuffDataByIndex(unitToken, index, filter)
local auraData = UnitDebuff(unitToken, index, filter)
if (not auraData) then
return nil
end
Expand Down

0 comments on commit 3b26d0d

Please sign in to comment.