bool AuctionHouseMgr::PendingAuctionAdd(Player* player, AuctionEntry* aEntry, Item* item) { PlayerAuctions* thisAH; auto itr = pendingAuctionMap.find(player->GetGUID()); if (itr != pendingAuctionMap.end()) { thisAH = itr->second.first; // Get deposit so far uint32 totalDeposit = 0; for (AuctionEntry const* thisAuction : *thisAH) totalDeposit += GetAuctionDeposit(thisAuction->auctionHouseEntry, thisAuction->etime, item, thisAuction->itemCount); // Add this deposit totalDeposit += GetAuctionDeposit(aEntry->auctionHouseEntry, aEntry->etime, item, aEntry->itemCount); if (!player->HasEnoughMoney(totalDeposit)) return false; } else { thisAH = new PlayerAuctions; pendingAuctionMap[player->GetGUID()] = AuctionPair(thisAH, 0); } thisAH->push_back(aEntry); return true; }
void AuctionHouseMgr::PendingAuctionAdd(Player* player, AuctionEntry* aEntry) { PlayerAuctions* thisAH; auto itr = pendingAuctionMap.find(player->GetGUID()); if (itr != pendingAuctionMap.end()) thisAH = itr->second.first; else { thisAH = new PlayerAuctions; pendingAuctionMap[player->GetGUID()] = AuctionPair(thisAH, 0); } thisAH->push_back(aEntry); }