Core/Misc: Moved CharacterInfo out of world to separate class

This commit is contained in:
Aokromes committed 2017-10-27 17:52:30 +02:00
1 parent 5373e2bd3b
commit 5e1a7bcfbb
43 files changed
+520 -391

No files matched your search

-42
View File
@@ -2331,48 +2331,6 @@ void ObjectMgr::RemoveGameobjectFromGrid(ObjectGuid::LowType guid, GameObjectDat
}
}
Player* ObjectMgr::GetPlayerByLowGUID(ObjectGuid::LowType lowguid) const
{
ObjectGuid guid(HighGuid::Player, lowguid);
return ObjectAccessor::FindPlayer(guid);
}
bool ObjectMgr::GetPlayerNameByGUID(ObjectGuid guid, std::string& name) const
{
CharacterInfo const* characterInfo = sWorld->GetCharacterInfo(guid);
if (!characterInfo)
return false;
name = characterInfo->Name;
return true;
}
uint32 ObjectMgr::GetPlayerTeamByGUID(ObjectGuid guid) const
{
CharacterInfo const* characterInfo = sWorld->GetCharacterInfo(guid);
if (!characterInfo)
return 0;
return Player::TeamForRace(characterInfo->Race);
}
uint32 ObjectMgr::GetPlayerAccountIdByGUID(ObjectGuid guid) const
{
if (CharacterInfo const* characterInfo = sWorld->GetCharacterInfo(guid))
return characterInfo->AccountId;
return 0;
}
uint32 ObjectMgr::GetPlayerAccountIdByPlayerName(std::string const& name) const
{
ObjectGuid guid = sWorld->GetCharacterGuidByName(name);
if (!guid.IsEmpty())
return GetPlayerAccountIdByGUID(guid);
return 0;
}
void ObjectMgr::LoadItemLocales()
{
uint32 oldMSTime = getMSTime();