Issue with autosell junk when vendor does not purchase items
gythwulf opened this issue ยท 2 comments
There is an issue where if you visit a vendor that will not purchase items and you have grey items in your bags, it will try to sell the items forever, effectively making the vendor non-usable for other purposes.
I have created a fix that checks to see if the item was sold before increasing the sold count (I apologize for the funky formatting, despite inserting the below as code, Github has decided that the "+" and "-" characters at the start of lines means it should be a separate bullet):
`
--- Leatrix_Plus/Leatrix_Plus.lua 2022-11-18 09:34:53.930910000 -0800
+++ Leatrix_Plus/Leatrix_Plus.lua 2022-11-20 11:17:09.311026181 -0800
@@ -3133,10 +3133,13 @@
-- Continue
local void, itemCount = C_Container.GetContainerItemInfo(BagID, BagSlot)
if Rarity == 0 and ItemPrice ~= 0 then
-
SoldCount = SoldCount + 1 if MerchantFrame:IsShown() then -- If merchant frame is open, vendor the item C_Container.UseContainerItem(BagID, BagSlot)
-
local void, newItemCount = C_Container.GetContainerItemInfo(BagID, BagSlot)
-
if newItemCount ~= itemCount then
-
SoldCount = SoldCount + 1
-
end -- Perform actions on first iteration if SellJunkTicker._remainingIterations == IterationCount then -- Calculate total price
`