Mercurial > wow > inventory
comparison Plugins/ItemCountAddons/DataStore (without 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 |
comparison
equal
deleted
inserted
replaced
| 117:239e25a058c7 | 118:de18ef96983b |
|---|---|
| 9 for accountName in pairs(DataStore:GetAccounts()) do | 9 for accountName in pairs(DataStore:GetAccounts()) do |
| 10 | 10 |
| 11 -- Process all charracters | 11 -- Process all charracters |
| 12 for characterName, character in pairs(DataStore:GetCharacters(realm, accountName)) do | 12 for characterName, character in pairs(DataStore:GetCharacters(realm, accountName)) do |
| 13 -- Get only useful info (currency / gear shouldn't contain the stuff we are interested in) | 13 -- Get only useful info (currency / gear shouldn't contain the stuff we are interested in) |
| 14 local bag, bank = DataStore:GetContainerItemCount(character, itemId) or 0, 0; | 14 local bag, bank = DataStore:GetContainerItemCount(character, itemId); |
| 15 bag = (bag or 0); bank = (bank or 0); | |
| 15 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; | 16 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; |
| 16 local mail = DataStore:GetMailItemCount(character, itemId) or 0; | 17 local mail = DataStore:GetMailItemCount(character, itemId) or 0; |
| 17 | 18 |
| 18 totalCount = totalCount + bag + bank + auctionHouse + mail; | 19 totalCount = totalCount + bag + bank + auctionHouse + mail; |
| 19 end | 20 end |
| 23 end | 24 end |
| 24 | 25 |
| 25 local function GetCharacterCount(itemId) | 26 local function GetCharacterCount(itemId) |
| 26 local character = DataStore:GetCharacter(); | 27 local character = DataStore:GetCharacter(); |
| 27 | 28 |
| 28 local bag, bank = DataStore:GetContainerItemCount(character, itemId) or 0, 0; | 29 local bag, bank = DataStore:GetContainerItemCount(character, itemId); |
| 30 bag = (bag or 0); bank = (bank or 0); | |
| 29 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; | 31 local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId) or 0; |
| 30 local mail = DataStore:GetMailItemCount(character, itemId) or 0; | 32 local mail = DataStore:GetMailItemCount(character, itemId) or 0; |
| 31 | 33 |
| 32 return bag, bank, auctionHouse, mail; | 34 return bag, bank, auctionHouse, mail; |
| 33 end | 35 end |
