mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[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:
parent
35e8af7195
commit
8e48e44c22
5 changed files with 13 additions and 10 deletions
|
|
@ -514,7 +514,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data )
|
|||
sender_accId = sender->GetSession()->GetAccountId();
|
||||
sender_name = sender->GetName();
|
||||
}
|
||||
else
|
||||
else if (sender_guid)
|
||||
{
|
||||
// can be calculated early
|
||||
sender_accId = sObjectMgr.GetPlayerAccountIdByGUID(sender_guid);
|
||||
|
|
@ -525,7 +525,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data )
|
|||
sLog.outCommand(GetAccountId(), "GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)",
|
||||
GetPlayerName(), GetAccountId(), it->GetProto()->Name1, it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId);
|
||||
}
|
||||
else if(!sender)
|
||||
else if (!sender)
|
||||
sender_accId = sObjectMgr.GetPlayerAccountIdByGUID(sender_guid);
|
||||
|
||||
// check player existence
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue