Adjusted item delta code to account for acquiring new items.
pschifferer [02-19-09 - 18:33]
Adjusted item delta code to account for acquiring new items.
diff --git a/CauldronMain.lua b/CauldronMain.lua
index 9556efb..e4def62 100644
--- a/CauldronMain.lua
+++ b/CauldronMain.lua
@@ -309,11 +309,20 @@ function Cauldron:OnBagUpdate(event, bagid)
local items = Cauldron:GetItemDeltas(bagid);
local recalc = false;
for item, itemCount in pairs(items) do
+--@alpha@
+ self:debug("OnBagUpdate: item="..item.."; itemCount="..itemCount);
+--@end-alpha@
if itemCount > 0 then
-- adjust shopping list
+--@alpha@
+ self:debug("OnBagUpdate: adjust shopping list");
+--@end-alpha@
CauldronShopping:RemoveFromList(self.db.realm.shopping, self.vars.playername, item, itemCount);
-- adjust intermediate list
+--@alpha@
+ self:debug("OnBagUpdate: adjust intermediate list");
+--@end-alpha@
local queue = self.db.realm.userdata[self.vars.playername].queue;
local intItem = CauldronQueue:GetIntermediateItem(queue, item);
if intItem and (not recalc) then
diff --git a/CauldronUtil.lua b/CauldronUtil.lua
index 1f6f5cc..731d300 100644
--- a/CauldronUtil.lua
+++ b/CauldronUtil.lua
@@ -106,7 +106,7 @@ function Cauldron:GetItemDeltas(bagid)
local name = select(1, {GetItemInfo(link)});
local count = GetItemCount(link);
- local delta = 0;
+ local delta = count;
if inv[name] then
delta = count - inv[name].count;
end