Core: Add function to find players by low guid
--HG-- branch : trunk
This commit is contained in:
@@ -312,7 +312,7 @@ Group * ObjectMgr::GetGroupByGUID(uint32 guid) const
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Guild * ObjectMgr::GetGuildById(uint32 GuildId) const
|
||||
Guild* ObjectMgr::GetGuildById(uint32 GuildId) const
|
||||
{
|
||||
GuildMap::const_iterator itr = mGuildMap.find(GuildId);
|
||||
if (itr != mGuildMap.end())
|
||||
@@ -321,7 +321,7 @@ Guild * ObjectMgr::GetGuildById(uint32 GuildId) const
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Guild * ObjectMgr::GetGuildByName(const std::string& guildname) const
|
||||
Guild* ObjectMgr::GetGuildByName(const std::string& guildname) const
|
||||
{
|
||||
std::string search = guildname;
|
||||
std::transform(search.begin(), search.end(), search.begin(), ::toupper);
|
||||
@@ -1840,6 +1840,12 @@ void ObjectMgr::LoadGameobjectRespawnTimes()
|
||||
sLog.outString();
|
||||
}
|
||||
|
||||
Player* ObjectMgr::GetPlayerByLowGUID(uint32 lowguid) const
|
||||
{
|
||||
uint64 guid = MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER);
|
||||
return ObjectAccessor::FindPlayer(guid);
|
||||
}
|
||||
|
||||
// name must be checked to correctness (if received) before call this function
|
||||
uint64 ObjectMgr::GetPlayerGUIDByName(std::string name) const
|
||||
{
|
||||
|
||||
@@ -394,6 +394,7 @@ class ObjectMgr
|
||||
|
||||
Player* GetPlayer(const char* name) const { return sObjectAccessor.FindPlayerByName(name);}
|
||||
Player* GetPlayer(uint64 guid) const { return ObjectAccessor::FindPlayer(guid); }
|
||||
Player* GetPlayerByLowGUID(uint32 lowguid) const;
|
||||
|
||||
static GameObjectInfo const *GetGameObjectInfo(uint32 id) { return sGOStorage.LookupEntry<GameObjectInfo>(id); }
|
||||
int LoadReferenceVendor(int32 vendor, int32 item_id, std::set<uint32> *skip_vendors);
|
||||
|
||||
Reference in New Issue
Block a user