From 0f1868fa6cd1c53f5b330e43dbe6216bbb0c23ad Mon Sep 17 00:00:00 2001 From: pschifferer Date: Fri, 27 Mar 2009 04:47:43 +0000 Subject: [PATCH] Relocated the local queue variable. Added a check for updating the queue to only occur when the window is open (because you can't craft stuff when it's not, so there's no reason to adjust the queue). --- CauldronMain.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CauldronMain.lua b/CauldronMain.lua index 1608412..3e7c667 100644 --- a/CauldronMain.lua +++ b/CauldronMain.lua @@ -371,6 +371,8 @@ function Cauldron:OnBagUpdate(event, bagid) return; end + local queue = self.db.realm.userdata[self.vars.playername].queue; + -- check if the item acquired is in the intermediate list or shopping list local items = Cauldron:GetItemDeltas(bagid); local recalc = false; @@ -384,8 +386,6 @@ function Cauldron:OnBagUpdate(event, bagid) self:debug("OnBagUpdate: adjust shopping list"); --@end-alpha@ CauldronShopping:RemoveFromList(self.db.realm.shopping, self.vars.playername, item, itemCount); - - local queue = self.db.realm.userdata[self.vars.playername].queue; -- adjust intermediate list self:debug("OnBagUpdate: adjust intermediate list"); @@ -396,10 +396,12 @@ function Cauldron:OnBagUpdate(event, bagid) recalc = true; end - -- adjust queue - if self.makingItem == item then - self:debug("OnBagUpdate: adjust queue for item: "..self.makingItem); - CauldronQueue:AdjustItemCount(queue, item, -itemCount); + -- adjust queue, but only if window is open + if CauldronFrame:IsShown() then + if self.makingItem == item then + self:debug("OnBagUpdate: adjust queue for item: "..self.makingItem); + CauldronQueue:AdjustItemCount(queue, item, -itemCount); + end end end end -- 1.7.9.5