Skip to content

Commit 60d80b8

Browse files
authored
fix: integer underflow in buyer algorithm (#145)
1 parent db4165e commit 60d80b8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/AuctionHouseBot.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,11 @@ void AuctionHouseBot::Buy(Player* AHBplayer, AHBConfig* config, WorldSession* se
244244
LOG_INFO("module", "AHBot [{}]: Considering {} auctions per interval to bid on.", _id, config->GetBidsPerInterval());
245245
}
246246

247-
for (uint32 count = 1; count <= config->GetBidsPerInterval(); ++count)
248-
{
247+
for (
248+
uint32 count = 1;
249+
count <= config->GetBidsPerInterval() && !auctionsGuidsToConsider.empty();
250+
++count
251+
) {
249252
//
250253
// Choose a random auction from possible auctions
251254
//

0 commit comments

Comments
 (0)