Mercurial > wow > inventory
comparison Plugins/ItemCountAddons/DataStore (current account only).lua @ 118:de18ef96983b
Fixed issue with DataStore item count no including bank data.
author | Zerotorescue |
---|---|
date | Sat, 15 Jan 2011 16:24:39 +0100 |
parents | 3bec0ea44607 |
children | 08b887885bd5 |
comparison
equal
deleted
inserted
replaced
117:239e25a058c7 | 118:de18ef96983b |
---|---|
6 local totalCount = 0; | 6 local totalCount = 0; |
7 | 7 |
8 -- Process all charracters on this account (GetCharacters defaults to THIS_ACCOUNT) | 8 -- Process all charracters on this account (GetCharacters defaults to THIS_ACCOUNT) |
9 for characterName, character in pairs(DataStore:GetCharacters(realm, nil)) do | 9 for characterName, character in pairs(DataStore:GetCharacters(realm, nil)) do |
10 -- Get only useful info (currency / gear shouldn't contain the stuff we are interested in) | 10 -- Get only useful info (currency / gear shouldn't contain the stuff we are interested in) |
11 local bag, bank = DataStore:GetContainerItemCount(character, itemId) or 0, 0; | 11 local bag, bank = DataStore:GetContainerItemCount(character, itemId); |
12 bag = (bag or 0); bank = (bank or 0); | |
12 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; | 13 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; |
13 local mail = DataStore:GetMailItemCount(character, itemId) or 0; | 14 local mail = DataStore:GetMailItemCount(character, itemId) or 0; |
14 | 15 |
15 totalCount = totalCount + bag + bank + auctionHouse + mail; | 16 totalCount = totalCount + bag + bank + auctionHouse + mail; |
16 end | 17 end |
19 end | 20 end |
20 | 21 |
21 local function GetCharacterCount(itemId) | 22 local function GetCharacterCount(itemId) |
22 local character = DataStore:GetCharacter(); | 23 local character = DataStore:GetCharacter(); |
23 | 24 |
24 local bag, bank = DataStore:GetContainerItemCount(character, itemId) or 0, 0; | 25 local bag, bank = DataStore:GetContainerItemCount(character, itemId); |
26 bag = (bag or 0); bank = (bank or 0); | |
25 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; | 27 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; |
26 local mail = DataStore:GetMailItemCount(character, itemId) or 0; | 28 local mail = DataStore:GetMailItemCount(character, itemId) or 0; |
27 | 29 |
28 return bag, bank, auctionHouse, mail; | 30 return bag, bank, auctionHouse, mail; |
29 end | 31 end |