Mercurial > wow > itemauditor
comparison Core.lua @ 136:d3d5e82043d8
Ticket 43 - Updated the way ItemAuditor counts how many of each item you own to only count your current faction.
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Sat, 02 Oct 2010 13:01:09 -0700 |
parents | a529a4a4ccbe |
children | 526036e4358f |
comparison
equal
deleted
inserted
replaced
135:a529a4a4ccbe | 136:d3d5e82043d8 |
---|---|
377 local realm = GetRealmName() | 377 local realm = GetRealmName() |
378 local ds_account = 'Default' | 378 local ds_account = 'Default' |
379 function ItemAuditor:GetItemCount(searchID) | 379 function ItemAuditor:GetItemCount(searchID) |
380 local count = 0 | 380 local count = 0 |
381 for _, character in pairs(DataStore:GetCharacters(realm, ds_account)) do | 381 for _, character in pairs(DataStore:GetCharacters(realm, ds_account)) do |
382 local bag, bank = DataStore:GetContainerItemCount(character, searchID) | 382 if DataStore:GetCharacterFaction(character) == UnitFactionGroup("player") then |
383 count = count + (bag or 0) + (bank or 0) | 383 local bag, bank = DataStore:GetContainerItemCount(character, searchID) |
384 count = count + (DataStore:GetAuctionHouseItemCount(character, searchID) or 0) | 384 count = count + (bag or 0) + (bank or 0) |
385 count = count + (DataStore:GetInventoryItemCount(character, searchID) or 0) | 385 count = count + (DataStore:GetAuctionHouseItemCount(character, searchID) or 0) |
386 count = count + (DataStore:GetMailItemCount(character, searchID) or 0) | 386 count = count + (DataStore:GetInventoryItemCount(character, searchID) or 0) |
387 count = count + (DataStore:GetCurrencyItemCount(character, searchID) or 0) | 387 count = count + (DataStore:GetMailItemCount(character, searchID) or 0) |
388 count = count + (DataStore:GetCurrencyItemCount(character, searchID) or 0) | |
389 end | |
388 end | 390 end |
389 for guildName in pairs(self.db.factionrealm.enabled_guilds) do | 391 for guildName in pairs(self.db.factionrealm.enabled_guilds) do |
390 count = count + DataStore:GetGuildBankItemCount(DataStore:GetGuilds()[guildName], searchID) | 392 count = count + DataStore:GetGuildBankItemCount(DataStore:GetGuilds()[guildName], searchID) |
391 end | 393 end |
392 | 394 |