mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +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
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue