From 893eb041badc00b20d9f94dd07d5e665e75b7598 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Fri, 23 Mar 2012 14:59:17 +0100 Subject: [PATCH] Handle quest querying better --- Monomyth.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Monomyth.lua b/Monomyth.lua index 1da4e8f..3799ecb 100644 --- a/Monomyth.lua +++ b/Monomyth.lua @@ -176,27 +176,27 @@ Monomyth:Register('GUILDBANKFRAME_CLOSED', function() atBank = false end) -local query +local query, queried Monomyth:Register('QUEST_QUERY_COMPLETE', function() if(query) then - local bag = query - query = nil - GetQuestsCompleted(completedQuests) - Monomyth.BAG_UPDATE(bag) + Monomyth.BAG_UPDATE(query, true) end end) -Monomyth:Register('BAG_UPDATE', function(bag) +Monomyth:Register('BAG_UPDATE', function(bag, handled) if(bag < 0) then return end if(atBank) then return end - if(query) then return end + if(query == bag and not handled) then return end + + query = nil for slot = 1, GetContainerNumSlots(bag) do local _, id, active = GetContainerItemQuestInfo(bag, slot) if(id and not active) then - if(not next(completedQuests)) then + if(not queried) then query = bag + queried = true QueryQuestsCompleted() elseif(not completedQuests[id]) then UseContainerItem(bag, slot) -- 1.7.9.5