kaelonR / WoW-BuyemAll-live

5 stars 6 forks source link

Buyable quantity wrong when buying one currency with another #1

Closed KyrosKrane closed 4 years ago

KyrosKrane commented 4 years ago

In commit 4b59613f36bcb5398e244a1a4ba7343aea4bbb94, the code for buying currencies was optimized from:

            if (totalMax == 0) then
                self.fit = 10000000;    
            else    
                self.fit = totalMax - select(2, GetCurrencyInfo(self.itemLink));    
            end

to: https://github.com/J141/WoW-BuyemAll-live/blob/1a0003b4b7e08e3ab65370d116d5a2ca202a5dc4/BuyEmAll.lua#L216

However, this makes the self.fit get set to the amount you have owned, rather than the amount you can actually buy. The section after or should be totalmax - select(2, GetCurrencyInfo(self.itemLink))

kaelonR commented 4 years ago

Thank you for this. looks like i simply forgot to include totalMax in the code.

I'll fix this and release a new version later this evening.

kaelonR commented 4 years ago

This has now been fixed in the 3.5.8 release for WoW 9.0.1.