Core/ObjectMgr: Remove GetPlayer function (Remove double use of singletons)
This commit is contained in:
@@ -2015,7 +2015,7 @@ uint64 ObjectMgr::GetPlayerGUIDByName(std::string name) const
|
||||
bool ObjectMgr::GetPlayerNameByGUID(const uint64 &guid, std::string &name) const
|
||||
{
|
||||
// prevent DB access for online player
|
||||
if (Player* player = GetPlayer(guid))
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
{
|
||||
name = player->GetName();
|
||||
return true;
|
||||
@@ -2035,7 +2035,7 @@ 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))
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
{
|
||||
return Player::TeamForRace(player->getRace());
|
||||
}
|
||||
@@ -2054,7 +2054,7 @@ 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))
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
{
|
||||
return player->GetSession()->GetAccountId();
|
||||
}
|
||||
@@ -5427,7 +5427,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
||||
|
||||
Player *pl = NULL;
|
||||
if (serverUp)
|
||||
pl = GetPlayer((uint64)m->receiver);
|
||||
pl = ObjectAccessor::FindPlayer((uint64)m->receiver);
|
||||
|
||||
if (pl && pl->m_mailsLoaded)
|
||||
{ // this code will run very improbably (the time is between 4 and 5 am, in game is online a player, who has old mail
|
||||
|
||||
@@ -616,8 +616,6 @@ class ObjectMgr
|
||||
|
||||
typedef std::map<uint32, uint32> CharacterConversionMap;
|
||||
|
||||
Player* GetPlayer(const char* name) const { return sObjectAccessor->FindPlayerByName(name);}
|
||||
Player* GetPlayer(uint64 guid) const { return ObjectAccessor::FindPlayer(guid); }
|
||||
Player* GetPlayerByLowGUID(uint32 lowguid) const;
|
||||
|
||||
GameObjectTemplate const* GetGameObjectTemplate(uint32 entry);
|
||||
|
||||
Reference in New Issue
Block a user