[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

@ -1657,6 +1657,9 @@ Team ObjectMgr::GetPlayerTeamByGUID(ObjectGuid guid) const
uint32 ObjectMgr::GetPlayerAccountIdByGUID(ObjectGuid guid) const
{
if (!guid.IsPlayer())
return 0;
// prevent DB access for online player
if(Player* player = GetPlayer(guid))
return player->GetSession()->GetAccountId();