@@ -532,9 +532,7 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con
|
||||
possibleBids.erase(iter);
|
||||
|
||||
if (!auction)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// get exact item information
|
||||
Item *pItem = auctionmgr.GetAItem(auction->item_guidlow);
|
||||
|
||||
@@ -286,14 +286,14 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
|
||||
{
|
||||
uint64 auctioneer;
|
||||
uint32 auctionId;
|
||||
uint32 price;
|
||||
int32 price;
|
||||
recv_data >> auctioneer;
|
||||
recv_data >> auctionId >> price;
|
||||
|
||||
if (!auctionId || !price)
|
||||
if (!auctionId || price <= 0)
|
||||
return; //check for cheaters
|
||||
|
||||
Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer,UNIT_NPC_FLAG_AUCTIONEER);
|
||||
Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!pCreature)
|
||||
{
|
||||
sLog.outDebug("WORLD: HandleAuctionPlaceBid - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer)));
|
||||
@@ -304,7 +304,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap(pCreature->getFaction());
|
||||
AuctionHouseObject *auctionHouse = auctionmgr.GetAuctionsMap(pCreature->getFaction());
|
||||
|
||||
AuctionEntry *auction = auctionHouse->GetAuction(auctionId);
|
||||
Player *pl = GetPlayer();
|
||||
@@ -326,11 +326,11 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// cheating
|
||||
if (price <= auction->bid)
|
||||
if (price <= auction->bid || price <= auction->startbid)
|
||||
return;
|
||||
|
||||
// price too low for next bid if not buyout
|
||||
if ((price < auction->buyout || auction->buyout == 0) &&
|
||||
if (price < auction->buyout || auction->buyout == 0 &&
|
||||
price < auction->bid + auction->GetAuctionOutBid())
|
||||
{
|
||||
//auction has already higher bid, client tests it!
|
||||
@@ -344,25 +344,22 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((price < auction->buyout) || (auction->buyout == 0))
|
||||
if (price < auction->buyout || auction->buyout == 0)
|
||||
{
|
||||
if (auction->bidder > 0)
|
||||
{
|
||||
if (auction->bidder == pl->GetGUIDLow())
|
||||
{
|
||||
pl->ModifyMoney(-int32(price - auction->bid));
|
||||
}
|
||||
else
|
||||
{
|
||||
// mail to last bidder and return money
|
||||
SendAuctionOutbiddedMail(auction , price);
|
||||
SendAuctionOutbiddedMail(auction, price);
|
||||
pl->ModifyMoney(-int32(price));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pl->ModifyMoney(-int32(price));
|
||||
}
|
||||
|
||||
auction->bidder = pl->GetGUIDLow();
|
||||
auction->bid = price;
|
||||
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, price);
|
||||
@@ -376,16 +373,12 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
|
||||
{
|
||||
//buyout:
|
||||
if (pl->GetGUIDLow() == auction->bidder)
|
||||
{
|
||||
pl->ModifyMoney(-int32(auction->buyout - auction->bid));
|
||||
}
|
||||
else
|
||||
{
|
||||
pl->ModifyMoney(-int32(auction->buyout));
|
||||
if (auction->bidder) //buyout for bidded auction ..
|
||||
{
|
||||
SendAuctionOutbiddedMail(auction, auction->buyout);
|
||||
}
|
||||
}
|
||||
auction->bidder = pl->GetGUIDLow();
|
||||
auction->bid = auction->buyout;
|
||||
|
||||
Reference in New Issue
Block a user