diff options
author | ccrs <ccrs@users.noreply.github.com> | 2021-08-10 13:08:49 +0200 |
---|---|---|
committer | ccrs <ccrs@users.noreply.github.com> | 2021-08-10 13:08:49 +0200 |
commit | d49b6af71fae60f4bcb5fed4d745a020657f0b3a (patch) | |
tree | 70f26156016df5726f16bacae65a09240b727e3c | |
parent | 8c86c4446cb938f660859a627a662a1e66882fd3 (diff) |
Core/Game: include addtional parameter in Object::GetPlayerListInGrid
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.h | 4 | ||||
-rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 10 | ||||
-rw-r--r-- | src/server/game/Entities/Object/Object.h | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 6e80dc30438..eec1ce71700 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -403,9 +403,9 @@ inline void GetGameObjectListWithEntryInGrid(Container& container, WorldObject* } template <typename Container> -inline void GetPlayerListInGrid(Container& container, WorldObject* source, float maxSearchRange) +inline void GetPlayerListInGrid(Container& container, WorldObject* source, float maxSearchRange, bool alive = true) { - source->GetPlayerListInGrid(container, maxSearchRange); + source->GetPlayerListInGrid(container, maxSearchRange, alive); } #endif // TRINITY_SCRIPTEDCREATURE_H diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 616dc8c032e..95f25061d05 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -3148,9 +3148,9 @@ void WorldObject::GetCreatureListWithEntryInGrid(Container& creatureContainer, u } template <typename Container> -void WorldObject::GetPlayerListInGrid(Container& playerContainer, float maxSearchRange) const +void WorldObject::GetPlayerListInGrid(Container& playerContainer, float maxSearchRange, bool alive /*= true*/) const { - Trinity::AnyPlayerInObjectRangeCheck checker(this, maxSearchRange); + Trinity::AnyPlayerInObjectRangeCheck checker(this, maxSearchRange, alive); Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, playerContainer, checker); Cell::VisitWorldObjects(this, searcher, maxSearchRange); } @@ -3598,6 +3598,6 @@ template TC_GAME_API void WorldObject::GetCreatureListWithEntryInGrid(std::list< template TC_GAME_API void WorldObject::GetCreatureListWithEntryInGrid(std::deque<Creature*>&, uint32, float) const; template TC_GAME_API void WorldObject::GetCreatureListWithEntryInGrid(std::vector<Creature*>&, uint32, float) const; -template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::list<Player*>&, float) const; -template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::deque<Player*>&, float) const; -template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::vector<Player*>&, float) const; +template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::list<Player*>&, float, bool) const; +template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::deque<Player*>&, float, bool) const; +template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::vector<Player*>&, float, bool) const; diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index e9a52101264..30df1d97fdc 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -460,7 +460,7 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation void GetCreatureListWithEntryInGrid(Container& creatureContainer, uint32 entry, float maxSearchRange = 250.0f) const; template <typename Container> - void GetPlayerListInGrid(Container& playerContainer, float maxSearchRange) const; + void GetPlayerListInGrid(Container& playerContainer, float maxSearchRange, bool alive = true) const; void DestroyForNearbyPlayers(); virtual void UpdateObjectVisibility(bool forced = true); |