diff --git a/api/unitframes.lua b/api/unitframes.lua index 2f949ee5..d368dec0 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -73,8 +73,8 @@ end local function BuffOnClick() if this:GetParent().label == "player" then - local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, "HELPFUL") - if bid >= 0 then CancelPlayerBuff(bid) end + local aura = C_UnitAuras.GetAuraDataByIndex("player", this.id, "HELPFUL") + if aura and aura.spellId then C_Spell.CancelSpellByID(aura.spellId) end end end @@ -114,8 +114,8 @@ end local function DebuffOnClick() if this:GetParent().label == "player" then - local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, "HARMFUL") - if bid >= 0 then CancelPlayerBuff(bid) end + local aura = C_UnitAuras.GetAuraDataByIndex("player", this.id, "HARMFUL") + if aura and aura.spellId then C_Spell.CancelSpellByID(aura.spellId) end end end diff --git a/modules/buff.lua b/modules/buff.lua index 55c9e907..19f457f7 100644 --- a/modules/buff.lua +++ b/modules/buff.lua @@ -60,6 +60,7 @@ pfUI:RegisterModule("buff", function () buff.mode = buff.btype buff.expirationTime = aura.expirationTime buff.stackCount = aura.applications + buff.spellId = aura.spellId buff.texture:SetTexture(aura.icon) if buff.btype == "HARMFUL" then @@ -146,9 +147,8 @@ pfUI:RegisterModule("buff", function () CancelItemTempEnchantment(1) elseif CancelItemTempEnchantment and this.mode and this.mode == "OFFHAND" then CancelItemTempEnchantment(2) - else - local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, this.btype) - if bid >= 0 then CancelPlayerBuff(bid) end + elseif this.spellId then + C_Spell.CancelSpellByID(this.spellId) end end) diff --git a/modules/buffwatch.lua b/modules/buffwatch.lua index 3e4fee86..e353cd07 100644 --- a/modules/buffwatch.lua +++ b/modules/buffwatch.lua @@ -99,8 +99,8 @@ pfUI:RegisterModule("buffwatch", function () DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc" .. skill .. "|r" .. T["is now blacklisted."]) end elseif this.parent.unit == "player" then - local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, this.type) - if bid >= 0 then CancelPlayerBuff(bid) end + local aura = C_UnitAuras.GetAuraDataByIndex("player", this.id, this.type) + if aura and aura.spellId then C_Spell.CancelSpellByID(aura.spellId) end end end