fix(Core): Crashfix. (#11495)

This commit is contained in:
UltraNix 2022-04-25 14:26:03 +02:00 committed by GitHub
parent 14f10bdf60
commit 3a525b8345
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -731,6 +731,9 @@ bool AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
{
uint32 itrcounter = 0;
// Ensures that listfrom is not greater that auctions count
listfrom = std::min(listfrom, static_cast<uint32>(GetAuctions().size()));
std::vector<AuctionEntry*> auctionShortlist;
// pussywizard: optimization, this is a simplified case
@ -880,8 +883,13 @@ bool AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
}
}
if (auctionShortlist.empty())
{
return true;
}
// Check if sort enabled, and first sort column is valid, if not don't sort
if (sortOrder.size() > 0)
if (!sortOrder.empty())
{
AuctionSortInfo const& sortInfo = *sortOrder.begin();
if (sortInfo.sortOrder >= AUCTION_SORT_MINLEVEL && sortInfo.sortOrder < AUCTION_SORT_MAX && sortInfo.sortOrder != AUCTION_SORT_UNK4)