From f95974357f7db10ec7f1a80833175b2f08fd8edb Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 15 Feb 2025 17:13:28 +0100 Subject: [PATCH] autovendor: dont rely on internal sellvalue database --- modules/autovendor.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/autovendor.lua b/modules/autovendor.lua index 0f1169be..57c259ab 100644 --- a/modules/autovendor.lua +++ b/modules/autovendor.lua @@ -41,7 +41,7 @@ pfUI:RegisterModule("autovendor", "vanilla:tbc", function () autovendor:SetScript("OnShow", function() processed = {} this.count = 0 - this.price = 0 + this.gold = GetMoney() end) autovendor:SetScript("OnUpdate", function() @@ -66,7 +66,6 @@ pfUI:RegisterModule("autovendor", "vanilla:tbc", function () local _, _, id = string.find(GetContainerItemLink(bag, slot), "item:(%d+):%d+:%d+:%d+") if pfSellData[tonumber(id)] then local _, _, sell, buy = strfind(pfSellData[tonumber(id)], "(.*),(.*)") - this.price = this.price + ( sell * ( icount or 1 ) ) this.count = this.count + 1 end @@ -80,7 +79,11 @@ pfUI:RegisterModule("autovendor", "vanilla:tbc", function () autovendor:SetScript("OnHide", function() if this.count > 0 then - DEFAULT_CHAT_FRAME:AddMessage(T["Your vendor trash has been sold and you earned"] .. " " .. CreateGoldString(this.price)) + local gold = this.gold + QueueFunction(function() + local income = GetMoney() - gold + DEFAULT_CHAT_FRAME:AddMessage(T["Your vendor trash has been sold and you earned"] .. " " .. CreateGoldString(income)) + end) end end)