From a5a6b84ecb10f0dfc1481e1d97d89ea05c9d0a04 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Wed, 18 May 2011 00:36:28 +0200 Subject: [PATCH] Possible fix to the disconnects --- Monomyth.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Monomyth.lua b/Monomyth.lua index 3579042..d234d8a 100644 --- a/Monomyth.lua +++ b/Monomyth.lua @@ -1,6 +1,7 @@ local addon = CreateFrame('Frame') addon:SetScript('OnEvent', function(self, event, ...) self[event](...) end) +local CURRENT local COMPLETE = [=[Interface\GossipFrame\ActiveQuestIcon]=] function addon:Register(event, func) @@ -51,6 +52,10 @@ addon:Register('QUEST_DETAIL', function() else QuestFrame_OnEvent(nil, 'QUEST_DETAIL') AcceptQuest() + + if(GetQuestID() == CURRENT) then + addon:RegisterEvent('BAG_UPDATE') + end end end) @@ -104,9 +109,9 @@ addon:Register('BAG_UPDATE', function(bag) for slot = 1, GetContainerNumSlots(bag) do local _, id, active = GetContainerItemQuestInfo(bag, slot) if(id and not active) then - -- We should check if the item is cached yet - -- The negative result of this is a disconnect + CURRENT = id UseContainerItem(bag, slot) + addon:UnregisterEvent('BAG_UPDATE') end end end) -- 1.7.9.5