mod-ah-bot icon indicating copy to clipboard operation
mod-ah-bot copied to clipboard

Refactor AuctionHouseBot.cpp + small bugfix

Open PixelWeaver opened this issue 1 year ago • 0 comments

Changes Proposed:

  • Renaming of the BuyPrice config members into something more meaningful to help with readability
  • Refactor in AuctionHouseBot.cpp for readability
  • Refactor and bugfix in AuctionHouseBot::Buy (make variable names more meaningful, simplify some if/else, move some checks to a little earlier when relevant, most importantly, properly remove auction from auctionPool: erase takes an iterator argument when you want to delete an element at a specific position, giving it a uint32 will make it look for that value in the set).

Issues Addressed:

  • Fixes an issue where the bot sometimes bids several times the above ceiling value.

Tests Performed:

  • Builds without error
  • Doesn't purchase above the ceiling value anymore

How to Test the Changes:

  1. Sell 20 green items with a sell price.
  2. For each of them, set the bidding price at exactly the ceiling value minus 1 copper (sell_price_in_copper * 5 - 1), do not put a buyout price.
  3. Do this with and without the changes in this branch: with the changes, you'll never have more than the ceiling value, without the changes you'll experience the issue where the bot bids sometimes above twice the ceiling value.

PixelWeaver avatar Nov 02 '24 15:11 PixelWeaver