mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
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 0d5adf356e)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user