Fix up uses of UnitBuff and UnitDebuff for 11.0.2

This commit is contained in:
Parnic
2024-07-21 14:00:48 -05:00
parent f15dda769d
commit 40efe6a551
4 changed files with 48 additions and 0 deletions

View File

@ -45,6 +45,18 @@ if C_Spell and C_Spell.GetSpellName then
GetSpellName = C_Spell.GetSpellName GetSpellName = C_Spell.GetSpellName
end end
local UnitBuff = UnitBuff
if not UnitBuff and C_UnitAuras and AuraUtil then
UnitBuff = function(unitToken, index, filter)
local auraData = C_UnitAuras.GetBuffDataByIndex(unitToken, index, filter)
if not auraData then
return nil
end
return AuraUtil.UnpackAuraData(auraData)
end
end
-- Constructor -- -- Constructor --
function RollTheBones.prototype:init() function RollTheBones.prototype:init()
RollTheBones.super.prototype.init(self, "RollTheBones", "player") RollTheBones.super.prototype.init(self, "RollTheBones", "player")

View File

@ -53,6 +53,18 @@ if Enum and Enum.PowerType then
SPELL_POWER_COMBO_POINTS = Enum.PowerType.ComboPoints SPELL_POWER_COMBO_POINTS = Enum.PowerType.ComboPoints
end end
local UnitBuff = UnitBuff
if not UnitBuff and C_UnitAuras and AuraUtil then
UnitBuff = function(unitToken, index, filter)
local auraData = C_UnitAuras.GetBuffDataByIndex(unitToken, index, filter)
if not auraData then
return nil
end
return AuraUtil.UnpackAuraData(auraData)
end
end
-- Constructor -- -- Constructor --
function SliceAndDice.prototype:init() function SliceAndDice.prototype:init()
SliceAndDice.super.prototype.init(self, "SliceAndDice", "player") SliceAndDice.super.prototype.init(self, "SliceAndDice", "player")

View File

@ -42,6 +42,18 @@ if C_Spell and C_Spell.GetSpellName then
GetSpellName = C_Spell.GetSpellName GetSpellName = C_Spell.GetSpellName
end end
local UnitDebuff = UnitDebuff
if not UnitDebuff and C_UnitAuras and AuraUtil then
UnitDebuff = function(unitToken, index, filter)
local auraData = C_UnitAuras.GetDebuffDataByIndex(unitToken, index, filter)
if not auraData then
return nil
end
return AuraUtil.UnpackAuraData(auraData)
end
end
StaggerBar.prototype.StaggerDuration = 0 StaggerBar.prototype.StaggerDuration = 0
StaggerBar.prototype.StaggerEndTime = 0 StaggerBar.prototype.StaggerEndTime = 0

View File

@ -4,6 +4,18 @@ local DogTag = nil
local TargetOfTarget = IceCore_CreateClass(IceElement) local TargetOfTarget = IceCore_CreateClass(IceElement)
local UnitDebuff = UnitDebuff
if not UnitDebuff and C_UnitAuras and AuraUtil then
UnitDebuff = function(unitToken, index, filter)
local auraData = C_UnitAuras.GetDebuffDataByIndex(unitToken, index, filter)
if not auraData then
return nil
end
return AuraUtil.UnpackAuraData(auraData)
end
end
TargetOfTarget.prototype.stackedDebuffs = nil TargetOfTarget.prototype.stackedDebuffs = nil
TargetOfTarget.prototype.buffSize = nil TargetOfTarget.prototype.buffSize = nil
TargetOfTarget.prototype.height = nil TargetOfTarget.prototype.height = nil