Skip to content

Commit

Permalink
Fix up uses of UnitBuff and UnitDebuff for 11.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
parnic committed Jul 21, 2024
1 parent f15dda7 commit 40efe6a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/RollTheBones.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ if C_Spell and C_Spell.GetSpellName then
GetSpellName = C_Spell.GetSpellName
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 --
function RollTheBones.prototype:init()
RollTheBones.super.prototype.init(self, "RollTheBones", "player")
Expand Down
12 changes: 12 additions & 0 deletions modules/SliceAndDice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ if Enum and Enum.PowerType then
SPELL_POWER_COMBO_POINTS = Enum.PowerType.ComboPoints
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 --
function SliceAndDice.prototype:init()
SliceAndDice.super.prototype.init(self, "SliceAndDice", "player")
Expand Down
12 changes: 12 additions & 0 deletions modules/Stagger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ if C_Spell and C_Spell.GetSpellName then
GetSpellName = C_Spell.GetSpellName
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.StaggerEndTime = 0

Expand Down
12 changes: 12 additions & 0 deletions modules/TargetOfTarget.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ local DogTag = nil

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.buffSize = nil
TargetOfTarget.prototype.height = nil
Expand Down

0 comments on commit 40efe6a

Please sign in to comment.