Mercurial > wow > inventory
comparison Plugins/ItemCountAddons/DataStore (with guilds).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 | 314943963155 |
comparison
equal
deleted
inserted
replaced
117:239e25a058c7 | 118:de18ef96983b |
---|---|
11 for accountName in pairs(DataStore:GetAccounts()) do | 11 for accountName in pairs(DataStore:GetAccounts()) do |
12 | 12 |
13 -- Process all charracters | 13 -- Process all charracters |
14 for characterName, character in pairs(DataStore:GetCharacters(realm, accountName)) do | 14 for characterName, character in pairs(DataStore:GetCharacters(realm, accountName)) do |
15 -- Get only useful info (currency / gear shouldn't contain the stuff we are interested in) | 15 -- Get only useful info (currency / gear shouldn't contain the stuff we are interested in) |
16 local bag, bank = DataStore:GetContainerItemCount(character, itemId) or 0, 0; | 16 local bag, bank = DataStore:GetContainerItemCount(character, itemId); |
17 bag = (bag or 0); bank = (bank or 0); | |
17 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; | 18 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; |
18 local mail = DataStore:GetMailItemCount(character, itemId) or 0; | 19 local mail = DataStore:GetMailItemCount(character, itemId) or 0; |
19 | 20 |
20 totalCount = totalCount + bag + bank + auctionHouse + mail; | 21 totalCount = totalCount + bag + bank + auctionHouse + mail; |
21 end | 22 end |
38 end | 39 end |
39 | 40 |
40 local function GetCharacterCount(itemId) | 41 local function GetCharacterCount(itemId) |
41 local character = DataStore:GetCharacter(); | 42 local character = DataStore:GetCharacter(); |
42 | 43 |
43 local bag, bank = DataStore:GetContainerItemCount(character, itemId) or 0, 0; | 44 local bag, bank = DataStore:GetContainerItemCount(character, itemId); |
45 bag = (bag or 0); bank = (bank or 0); | |
44 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; | 46 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; |
45 local mail = DataStore:GetMailItemCount(character, itemId) or 0; | 47 local mail = DataStore:GetMailItemCount(character, itemId) or 0; |
46 | 48 |
47 return bag, bank, auctionHouse, mail; | 49 return bag, bank, auctionHouse, mail; |
48 end | 50 end |