Core/ObjectMgr: Remove GetPlayer function (Remove double use of singletons)

This commit is contained in:
Spp- committed 2011-07-27 12:14:27 +02:00
1 parent fa50c0a464
commit b2a84d9f1e
47 files changed
+166 -168

No files matched your search

+4 -4
View File
@@ -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