Bug - Fixed Purchasing with forced sort may buy more items than requested

PeKaJe

Member
In the example I was given, the search was for "lasagna", which at this time has the lowest price for all 3 types in 1/day limited stores.
The next cheapest after those were fishy lasagna in another store.
The top 4 rows were selected and purchase was clicked, when prompted for amount to buy, 5 was entered.
The expected result was that the 3 day-limited lasagnas would be bought first, then 2 additional fishy lasagna would be bought from the next cheapest store.
The actual result was that the 3 day-limited lasagnas were bought, then an additional 4 fishy lasagna were bought from the next cheapest store.
 

Veracity

Developer
Staff member
Yeah. Looks like KoLmafia.makePurchases assumes that you are purchasing the same item from multiple stores, not different items from multiple stores. Shouldn't be TOO hard to make it work either way...
 

Veracity

Developer
Staff member
OK. I searched for "hi mein", and selected two adjacent stores - one with a 1/day limit of one type, one with 30 of another type. It doesn't even matter if you have force sort or that the stores be adjacent: you can click select to make a disjoint selection, if you want. KoLmafia told me "31 spooky hi mein for 160,850 Meat"; the Purchases frame obviously thinks you are purchasing only one kind of item, but as you observed when you wrote this Bug Report, the backend doesn't care that you are purchasing multiple different kinds of item.

I told KoLmafia to purchase 3 items.

Code:
Searching for hi mein...
Search complete.
Purchasing sleazy hi mein (1 @ 5,000)...
Purchasing spooky hi mein (2 @ 5,195)...
Purchases complete.
As you can see, it worked.

Revision 15996
 
Top