mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
Fix.
This commit is contained in:
parent
0f5380a385
commit
94fdc7e37e
3 changed files with 208 additions and 282 deletions
|
|
@ -1466,6 +1466,12 @@ bool ObjectMgr::GetPlayerNameByGUID(const uint64 &guid, std::string &name) const
|
|||
|
||||
uint32 ObjectMgr::GetPlayerTeamByGUID(const uint64 &guid) const
|
||||
{
|
||||
// prevent DB access for online player
|
||||
if(Player* player = GetPlayer(guid))
|
||||
{
|
||||
return Player::TeamForRace(player->getRace());
|
||||
}
|
||||
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT race FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
|
||||
|
||||
if(result)
|
||||
|
|
@ -1480,6 +1486,12 @@ uint32 ObjectMgr::GetPlayerTeamByGUID(const uint64 &guid) const
|
|||
|
||||
uint32 ObjectMgr::GetPlayerAccountIdByGUID(const uint64 &guid) const
|
||||
{
|
||||
// prevent DB access for online player
|
||||
if(Player* player = GetPlayer(guid))
|
||||
{
|
||||
return player->GetSession()->GetAccountId();
|
||||
}
|
||||
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
|
||||
if(result)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue