+ Reply to Thread
Results 1 to 1 of 1

Thread: Buff events and teleports

  1. #1
    Plane Walker Kreiri's Avatar
    Join Date
    Feb 2011
    Posts
    402

    Default Buff events and teleports

    Code:

    Code:
    local function OnBuffAdd(unit, buffs) 
    	if unit == Inspect.Unit.Lookup("player") then
    		local d = Inspect.Buff.Detail(unit, buffs)
    		for id, info in pairs(d) do
    			print("+++ "..id.." - "..info.name)
    		end
    	end
    end
    
    local function OnBuffRemove(unit, buffs) 
    	if unit == Inspect.Unit.Lookup("player") then
    		for id, info in pairs(buffs) do
    			print("--- "..id)
    		end
    	end
    end
    
    table.insert (Event.Buff.Add, {OnBuffAdd, "Dummy", "OnBuffAdd"})
    table.insert (Event.Buff.Remove, {OnBuffRemove, "Dummy", "OnBuffRemove"})
    Result:

    20:53:02: [Dummy] +++ b80000000030C5370 - Fanfare of Knowledge
    20:53:02: [Dummy] +++ b80000000030C53C8 - Anthem of Defiance
    -- I purchased teleport --
    20:53:17: [Dummy] +++ b80000000030C5370 - Fanfare of Knowledge
    20:53:17: [1. Ember Isle]: You left the channel
    20:53:17: [1. Meridian]: You joined the channel
    20:53:17: [3. Trade]: You joined the channel
    20:53:17: [Dummy] --- b80000000030C5370
    20:53:17: [Dummy] +++ b80000000030C53D3 - Fanfare of Knowledge
    20:53:17: [Dummy] +++ b80000000030C53FD - PvP Invulnerability
    20:53:17: [Dummy] +++ b80000000030C542B - Anthem of Defiance

    So, what do we have here:
    I had two buffs on me, Fanfare of Knowledge and Anthem of Defiance. After I purchased teleport, I got Buff.Add event for Fanfare of Knowledge - with same id - but not for Anthem of Defiance.

    Then, after I zoned in, I got:
    Buff.Remove for this instance of Fanfare of Knowledge and two Buff.Add events for new instances of Fanfare of Knowledge and Anthem of Defiance. Note that Buff.Remove for old instance of Anthem of Defiance was never received.

    It means that Anthem of Defiance leaves a ghost buff bar in KBB on teleporting, because while KBB added a bar for new buff ID, it never got a .Remove event for old buff ID and didn't remove the old bar.

    I've received bug reports for anthems and consumables doing this. Please, either make Buff.Remove event fire for all instances of buffs which are replaced on teleport, or give me some reliable event to detect teleport so I can force rescan in my code.
    Last edited by Kreiri; 03-08-2012 at 02:58 PM.
    Feminism is the radical notion that women are people.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts