Mercurial > wow > itemauditor
comparison Core.lua @ 80:19609b3af2d7
Fixed Bug 22 - Exchanging player bags for bank bags changes invested
| author | Asa Ayers <Asa.Ayers@Gmail.com> |
|---|---|
| date | Thu, 05 Aug 2010 19:39:00 -0700 |
| parents | 71de6e86a1a4 |
| children | 64166ba5209a |
comparison
equal
deleted
inserted
replaced
| 79:d1ce6df53d94 | 80:19609b3af2d7 |
|---|---|
| 158 function ItemAuditor:Print(message, ...) | 158 function ItemAuditor:Print(message, ...) |
| 159 message = format(message, ...) | 159 message = format(message, ...) |
| 160 getOptions().GetSelectedChatWindow():AddMessage( printPrefix .. tostring(message)) | 160 getOptions().GetSelectedChatWindow():AddMessage( printPrefix .. tostring(message)) |
| 161 end | 161 end |
| 162 | 162 |
| 163 local function scanBag(bagID, i) | |
| 164 bagSize=GetContainerNumSlots(bagID) | |
| 165 for slotID = 0, bagSize do | |
| 166 local link= GetContainerItemLink(bagID, slotID); | |
| 167 link = link and ItemAuditor:GetSafeLink(link) | |
| 168 | |
| 169 if link ~= nil and i[link] == nil then | |
| 170 i[link] = GetItemCount(link, true); | |
| 171 end | |
| 172 end | |
| 173 end | |
| 174 | |
| 163 function ItemAuditor:GetCurrentInventory() | 175 function ItemAuditor:GetCurrentInventory() |
| 164 local i = {} | 176 local i = {} |
| 165 local bagID | 177 local bagID |
| 166 local slotID | 178 local slotID |
| 167 | 179 |
| 168 for bagID = 0, NUM_BAG_SLOTS do | 180 for bagID = 0, NUM_BAG_SLOTS do |
| 169 bagSize=GetContainerNumSlots(bagID) | 181 scanBag(bagID, i) |
| 170 for slotID = 0, bagSize do | 182 end |
| 171 local link= GetContainerItemLink(bagID, slotID); | 183 |
| 172 link = link and self:GetSafeLink(link) | 184 scanBag(BANK_CONTAINER, i) |
| 173 | 185 for bagID = NUM_BAG_SLOTS+1, NUM_BANKBAGSLOTS do |
| 174 if link ~= nil and i[link] == nil then | 186 scanBag(bagID, i) |
| 175 i[link] = GetItemCount(link); | 187 end |
| 176 end | 188 |
| 177 end | |
| 178 | |
| 179 end | |
| 180 return {items = i, money = GetMoney()} | 189 return {items = i, money = GetMoney()} |
| 181 end | 190 end |
| 182 | 191 |
| 183 function ItemAuditor:GetInventoryDiff(pastInventory, current) | 192 function ItemAuditor:GetInventoryDiff(pastInventory, current) |
| 184 if current == nil then | 193 if current == nil then |
