Smiling Spectre
Member
Well, just it. Main point of advertising is to be higher in resulting query. But Mafia totally ignores it, so when I am making query, it sorts all same-priced offers by amount (biggest first). Can it be fixed, please?
However, if there's 20 stores with 1000 items limit 1 and one store with 100 items, mafia will buy from the limit 1 stores before buying from the 100 item store. I added this to my code:Let's put it like this:
I tell KoLmafia to buy 100 limes
There are 12 stores with 5 limes each and then a store with 1000, all at the same price
Kolmafia will obtain the 100 limes with a single server request
Apparently, you would prefer that it buy 5 from each of the 12 stores and then 40 from the 13th one.
Index: src/net/sourceforge/kolmafia/request/PurchaseRequest.java
===================================================================
--- src/net/sourceforge/kolmafia/request/PurchaseRequest.java (revision 12564)
+++ src/net/sourceforge/kolmafia/request/PurchaseRequest.java (working copy)
@@ -332,6 +332,11 @@
return KoLCharacter.isHardcore() ? 1 : -1;
}
+ /* improve sorting */
+ if ( this.limit != pr.limit ) {
+ return pr.limit - this.limit;
+ }
+
if ( this.quantity != pr.quantity )
{
return pr.quantity - this.quantity;
// limit is how many items you can actually buy
// sort high to low on limit
if ( this.limit != pr.limit )
{
return pr.limit - this.limit;
}
// If limits are equal but quantity is not, one or the other
// stores has an artificial limit. Reward those that don't do
// that by sorting low to high on quantity.
if ( this.quantity != pr.quantity )
{
return this.quantity - pr.quantity;
}