[11730] Move empty guid check into GetPlayerAccountIdByGUID code.

This cleanup small code and let catch some missing check cases
when 0 guid attempt searched by real DB query.

This also make function call more safe if it used with non-player guid by
some reason.
This commit is contained in:
VladimirMangos 2011-07-10 05:28:53 +04:00
parent 35e8af7195
commit 8e48e44c22
5 changed files with 13 additions and 10 deletions

View file

@ -155,7 +155,7 @@ void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction)
Player *oldBidder = sObjectMgr.GetPlayer(oldBidder_guid);
uint32 oldBidder_accId = 0;
if(!oldBidder && oldBidder_guid)
if(!oldBidder)
oldBidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(oldBidder_guid);
// old bidder exist
@ -180,7 +180,7 @@ void WorldSession::SendAuctionCancelledToBidderMail(AuctionEntry* auction)
Player *bidder = sObjectMgr.GetPlayer(bidder_guid);
uint32 bidder_accId = 0;
if (!bidder && bidder_guid)
if (!bidder)
bidder_accId = sObjectMgr.GetPlayerAccountIdByGUID(bidder_guid);
// bidder exist
@ -409,7 +409,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
// impossible have online own another character (use this for speedup check in case online owner)
Player* auction_owner = sObjectMgr.GetPlayer(ownerGuid);
if (!auction_owner && ownerGuid && sObjectMgr.GetPlayerAccountIdByGUID(ownerGuid) == pl->GetSession()->GetAccountId())
if (!auction_owner && sObjectMgr.GetPlayerAccountIdByGUID(ownerGuid) == pl->GetSession()->GetAccountId())
{
// you cannot bid your another character auction:
SendAuctionCommandResult(NULL, AUCTION_BID_PLACED, AUCTION_ERR_BID_OWN);