mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 12:10:01 +00:00
buffs: cancel by spellID instead of GetPlayerBuff slot index
`GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, filter)` assumes the visual index pfUI shows matches the engine's slot order. When that mismapping happens — most easily reproduced by stacking buffs that share a slot family — right-clicking one buff cancels another. `C_Spell.CancelSpellByID(spellID)` ships CMSG_CANCEL_AURA keyed to the spell, not a slot, so it's immune to whatever order the slot table is in. Cache `spellId` on the button at refresh time in buff.lua; in the unitframes/buffwatch handlers fetch the aura fresh via `C_UnitAuras.GetAuraDataByIndex` at click time. Fixes #10.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user