fix(seller): reserve a share of each cycle for items without a price override - #37
Merged
Merged
Conversation
…override GetItemsToSell() returned its four blocks concatenated, and Sell() only ever walks the first ItemsPerCycle entries of that list. Blocks 1 and 2 hold every sellable price override item - thousands of them - so index 200 never reached block 3. An item without a row in mod_auctionhousebot_priceOverride was therefore never listed at all, however well it passed the filters. The price override blocks and the bin blocks are now collected separately and woven together, so AuctionHouseBot.BinItemShare percent of every stretch of the list belongs to items with no override. Default 25. Setting it to 0 restores the old concatenation order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the caveat I flagged in #36.
The bug
GetItemsToSell()returns four blocks concatenated:Sell()then walksitemsToSell[cnt]forcntin0 .. ItemsPerCycle-1— always the first 200 entries. Blocks 1 and 2 hold thousands of entries on this realm (~11.5k override rows), so index 200 never reaches block 3.Consequence: an item with no row in
mod_auctionhousebot_priceOverrideis never listed, no matter how cleanly it passes every filter. That is not a deliberate priority ordering, it is starvation — prioritisation by concatenation against a fixed per-cycle budget.It also undercuts #36: un-blacklisting the Shredder pages makes them eligible but not visible, unless they happen to carry override rows.
Fix
The two sources are collected separately and woven, so that over any stretch of the list
AuctionHouseBot.BinItemSharepercent of the slots belong to bin-only items:Default 25 — a 200-item cycle now lists ~50 items that have no price override, where it previously listed none.
0restores the old concatenation order exactly.Prices for those items fall back to the existing C++ path (
SellAtMarketPrice/BuyPrice/SellPricescaled by the per-quality min/max percentages), which is what that code was always there for.Verification
0produces the legacy order with bins strictly after priority items, no items lost, and exhausted-source cases terminate. All assertions pass.core-buildworkflow on this PR.Tuning note
25 percent is a starting point, not a measured optimum. The higher it goes, the slower the override-priced items restock; the lower it goes, the longer the tail of unpriced items takes to appear. Worth a look at the
TraceSellerline this adds — it logs both candidate counts and the applied share per cycle.