chore(unit-object-accessor): add findConnectedPlayer to object accessor (#3155)

This commit is contained in:
Stefano Borzì
2020-08-17 10:36:42 +02:00
committed by GitHub
parent c373668a41
commit 408366f39f
2 changed files with 10 additions and 3 deletions
@@ -177,6 +177,11 @@ Unit* ObjectAccessor::FindUnit(uint64 guid)
return GetObjectInWorld(guid, (Unit*)NULL);
}
Player* ObjectAccessor::FindConnectedPlayer(uint64 const& guid)
{
return HashMapHolder<Player>::Find(guid);
}
Player* ObjectAccessor::FindPlayerByName(std::string const& name, bool checkInWorld)
{
/*ACORE_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
+2
View File
@@ -189,7 +189,9 @@ class ObjectAccessor
static Pet* FindPet(uint64);
static Player* FindPlayer(uint64);
static Player* FindPlayerInOrOutOfWorld(uint64 m_guid);
static Unit* FindUnit(uint64);
static Player* FindConnectedPlayer(uint64 const&);
static Player* FindPlayerByName(std::string const& name, bool checkInWorld = true);
static std::map<std::string, Player*> playerNameToPlayerPointer; // pussywizard: optimization