diff options
author | treeston <treeston.mmoc@gmail.com> | 2016-05-13 00:56:52 +0200 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2017-01-08 16:56:21 +0100 |
commit | bef9683a300dbdfefd5b1c8e463bd6c5e5841ad6 (patch) | |
tree | c3b2230f0ba41e09beca579003872eb2556c411d /src | |
parent | 473efd5f35328bf09249c7c837b3d61eca384fa3 (diff) |
Core/Scripts: Added reasonable default params to GetCreatureListWithEntryInGrid/GetGameObjectListWithEntryInGrid for ease of use. Also, entry = 0 means no filter now, since we lacked an easy way to get a list of all creatures in grid.
(cherry picked from commit 0d5adf356ebaf57507c2a937e47db5e6b97c3e22)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Object/Object.h | 4 | ||||
-rw-r--r-- | src/server/game/Grids/Notifiers/GridNotifiers.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 0d82bcf9d8c..8c8877c1be2 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -654,8 +654,8 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation GameObject* FindNearestGameObject(uint32 entry, float range) const; GameObject* FindNearestGameObjectOfType(GameobjectTypes type, float range) const; - void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry, float fMaxSearchRange) const; - void GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry, float fMaxSearchRange) const; + void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry = 0, float fMaxSearchRange = 250.0f) const; + void GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry = 0, float fMaxSearchRange = 250.0f) const; void GetPlayerListInGrid(std::list<Player*>& lList, float fMaxSearchRange) const; void DestroyForNearbyPlayers(); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 322baa2a1ec..311bb9dee48 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1267,7 +1267,7 @@ namespace Trinity bool operator()(GameObject* go) const { - if (go->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(go, m_fRange, false)) + if ((!m_uiEntry || go->GetEntry() == m_uiEntry) && m_pObject->IsWithinDist(go, m_fRange, false)) return true; return false; @@ -1286,7 +1286,7 @@ namespace Trinity bool operator()(Unit* unit) const { - if (unit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(unit, m_fRange, false)) + if ((!m_uiEntry || unit->GetEntry() == m_uiEntry) && m_pObject->IsWithinDist(unit, m_fRange, false)) return true; return false; |