From 5b6bcbff1a94c4bc32c42f05d77af97d63cef420 Mon Sep 17 00:00:00 2001 From: ccrs Date: Tue, 10 Aug 2021 13:08:49 +0200 Subject: Core/Game: include addtional parameter in Object::GetPlayerListInGrid (cherry picked from commit d49b6af71fae60f4bcb5fed4d745a020657f0b3a) --- src/server/game/AI/ScriptedAI/ScriptedCreature.h | 4 ++-- src/server/game/Entities/Object/Object.cpp | 10 +++++----- src/server/game/Entities/Object/Object.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 3e719f24c5b..b984c8b5bdb 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -407,9 +407,9 @@ inline void GetGameObjectListWithEntryInGrid(Container& container, WorldObject* } template -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 d9993e84a94..7b9bd8a7b2b 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -3192,9 +3192,9 @@ void WorldObject::GetCreatureListWithEntryInGrid(Container& creatureContainer, u } template -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 searcher(this, playerContainer, checker); Cell::VisitWorldObjects(this, searcher, maxSearchRange); } @@ -3631,6 +3631,6 @@ template TC_GAME_API void WorldObject::GetCreatureListWithEntryInGrid(std::list< template TC_GAME_API void WorldObject::GetCreatureListWithEntryInGrid(std::deque&, uint32, float) const; template TC_GAME_API void WorldObject::GetCreatureListWithEntryInGrid(std::vector&, uint32, float) const; -template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::list&, float) const; -template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::deque&, float) const; -template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::vector&, float) const; +template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::list&, float, bool) const; +template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::deque&, float, bool) const; +template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::vector&, float, bool) const; diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 242f9151bd7..eec0d27c179 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -644,7 +644,7 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation void GetCreatureListWithEntryInGrid(Container& creatureContainer, uint32 entry, float maxSearchRange = 250.0f) const; template - 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); -- cgit v1.2.3