diff --git a/TradeSkillMaster/TradeSkillMaster.toc b/TradeSkillMaster/TradeSkillMaster.toc index 0eddcb3..753f7d8 100644 --- a/TradeSkillMaster/TradeSkillMaster.toc +++ b/TradeSkillMaster/TradeSkillMaster.toc @@ -2,7 +2,7 @@ ## Title: |cff00fe00TradeSkillMaster: Revived|r ## Notes: Core addon for the TradeSkillMaster suite, revived for Wrath of the Lich King. Does nothing without modules installed. ## Author: Sapu94, Bart39, Gnomezilla [Warmane-Icecrown(A)], BlueAo [Warmane], andrew6180, Yoshiyuka, DimaSheiko, and other contributors... -## Version: 2.3.17 +## Version: 2.3.18 ## SavedVariables: TradeSkillMasterAppDB, AscensionTSMDB ## OptionalDeps: AccurateTime, Ace3, LibDataBroker-1.1, LibDBIcon-1.0, LibExtraTip, TipHelper, LibParse, LibCompress, LibGraph-2.0, SharedMedia, TheUndermineJournal, TheUndermineJournalGE ## X-Embeds: AccurateTime, Ace3, LibDataBroker-1.1, LibDBIcon-1.0, LibExtraTip, TipHelper, LibParse, LibCompress, LibGraph-2.0 diff --git a/TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.lua b/TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.lua index 6955987..abd7268 100644 --- a/TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.lua +++ b/TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.lua @@ -236,12 +236,16 @@ function private.OnItemBought(_, data) TSM:DecodeItemData(itemID) local link = data.link or select(2, TSMAPI:GetSafeItemInfo(data.itemString)) or data.itemString local buyoutText = data.buyout and (TSMAPI:FormatTextMoney(data.buyout, "|cffffffff", true) or "---") or "---" - local total = TSM.data[itemID].quantity - local minBuyout = TSM:GetMinBuyout(itemID) + local total = 0 + local baseItemString = TSMAPI:GetBaseItemString(data.itemString) + for _, _, itemString, quantity in TSMAPI:GetBagIterator() do + if TSMAPI:GetBaseItemString(itemString) == baseItemString then + total = total + quantity + end + end local marketValue = TSM:GetMarketValue(itemID) - local minText = minBuyout and (TSMAPI:FormatTextMoney(minBuyout, "|cffffffff", true) or "---") or "---" local marketText = marketValue and (TSMAPI:FormatTextMoney(marketValue, "|cffffffff", true) or "---") or "---" - TSM:Printf("Bought %s for %s (x%d). items=%s dbmin=%s dbmarket=%s", link, buyoutText, data.count or 1, total and tostring(total) or "?", minText, marketText) + TSM:Printf("Bought %s for %s (x%d). bags=%s dbmarket=%s", link, buyoutText, data.count or 1, tostring(total), marketText) end function TSM:OnTSMDBShutdown() diff --git a/TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc b/TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc index ab3fb18..47ac2de 100644 --- a/TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc +++ b/TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc @@ -2,10 +2,10 @@ ## Title: |cff00ff00TradeSkillMaster_AuctionDB|r ## Notes: Stores auction house data and calculates market prices. ## Author: Sapu94, Bart39 -## Version: 2.3.17 +## Version: 2.3.18 ## SavedVariables: AscensionTSM_AuctionDB ## Dependency: TradeSkillMaster -## X-Curse-Packaged-Version: 2.3.17 +## X-Curse-Packaged-Version: 2.3.18 ## X-Curse-Project-Name: TradeSkillMaster_AuctionDB ## X-Curse-Project-ID: tradeskillmaster_auctiondb ## X-Curse-Repository-ID: wow/tradeskillmaster_auctiondb/mainline