mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 13:22:48 +01:00
Merge pull request #14103 from Epicurus4/6.x
Added a player searcher
(cherry picked from commit b7052d2ed7)
This commit is contained in:
@@ -663,3 +663,8 @@ void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject*
|
||||
{
|
||||
source->GetGameObjectListWithEntryInGrid(list, entry, maxSearchRange);
|
||||
}
|
||||
|
||||
void GetPlayerListInGrid(std::list<Player*>& list, WorldObject* source, float maxSearchRange)
|
||||
{
|
||||
source->GetPlayerListInGrid(list, maxSearchRange);
|
||||
}
|
||||
|
||||
@@ -425,5 +425,6 @@ Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float m
|
||||
GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange);
|
||||
void GetCreatureListWithEntryInGrid(std::list<Creature*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
|
||||
void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
|
||||
void GetPlayerListInGrid(std::list<Player*>& list, WorldObject* source, float maxSearchRange);
|
||||
|
||||
#endif // SCRIPTEDCREATURE_H_
|
||||
|
||||
@@ -2255,6 +2255,13 @@ void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureL
|
||||
cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange);
|
||||
}
|
||||
|
||||
void WorldObject::GetPlayerListInGrid(std::list<Player*>& playerList, float maxSearchRange) const
|
||||
{
|
||||
Trinity::AnyPlayerInObjectRangeCheck checker(this, maxSearchRange);
|
||||
Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, playerList, checker);
|
||||
this->VisitNearbyWorldObject(maxSearchRange, searcher);
|
||||
}
|
||||
|
||||
/*
|
||||
namespace Trinity
|
||||
{
|
||||
|
||||
@@ -683,6 +683,7 @@ class WorldObject : public Object, public WorldLocation
|
||||
|
||||
void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry, float fMaxSearchRange) const;
|
||||
void GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry, float fMaxSearchRange) const;
|
||||
void GetPlayerListInGrid(std::list<Player*>& lList, float fMaxSearchRange) const;
|
||||
|
||||
void DestroyForNearbyPlayers();
|
||||
virtual void UpdateObjectVisibility(bool forced = true);
|
||||
|
||||
Reference in New Issue
Block a user