mod-ah-bot
mod-ah-bot copied to clipboard
Refactor AuctionHouseBot.cpp + small bugfix
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:erasetakes 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:
- Sell 20 green items with a sell price.
- 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.
- 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.