# HG changeset patch # User Asa Ayers # Date 1281062340 25200 # Node ID 19609b3af2d7b34533e45393c633673f44dfde7c # Parent d1ce6df53d94a7f365273f4234248dd1ce354e53 Fixed Bug 22 - Exchanging player bags for bank bags changes invested diff -r d1ce6df53d94 -r 19609b3af2d7 CHANGELOG.txt --- a/CHANGELOG.txt Sun Aug 01 22:02:46 2010 -0700 +++ b/CHANGELOG.txt Thu Aug 05 19:39:00 2010 -0700 @@ -1,3 +1,7 @@ +2010-08-05 Asa Ayers + +- Fixed Bug 22 - Exchanging player bags for bank bags changes invested + 2010-08-01 Asa Ayers - Fixed the tooltip so that it is green if the auction price exactly matches your threshold. diff -r d1ce6df53d94 -r 19609b3af2d7 Core.lua --- a/Core.lua Sun Aug 01 22:02:46 2010 -0700 +++ b/Core.lua Thu Aug 05 19:39:00 2010 -0700 @@ -160,23 +160,32 @@ getOptions().GetSelectedChatWindow():AddMessage( printPrefix .. tostring(message)) end +local function scanBag(bagID, i) + bagSize=GetContainerNumSlots(bagID) + for slotID = 0, bagSize do + local link= GetContainerItemLink(bagID, slotID); + link = link and ItemAuditor:GetSafeLink(link) + + if link ~= nil and i[link] == nil then + i[link] = GetItemCount(link, true); + end + end +end + function ItemAuditor:GetCurrentInventory() local i = {} local bagID local slotID for bagID = 0, NUM_BAG_SLOTS do - bagSize=GetContainerNumSlots(bagID) - for slotID = 0, bagSize do - local link= GetContainerItemLink(bagID, slotID); - link = link and self:GetSafeLink(link) - - if link ~= nil and i[link] == nil then - i[link] = GetItemCount(link); - end - end - + scanBag(bagID, i) end + + scanBag(BANK_CONTAINER, i) + for bagID = NUM_BAG_SLOTS+1, NUM_BANKBAGSLOTS do + scanBag(bagID, i) + end + return {items = i, money = GetMoney()} end