mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +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.
This commit is contained in:
@@ -586,8 +586,8 @@ class 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();
|
||||
|
||||
@@ -1250,7 +1250,7 @@ namespace Trinity
|
||||
AllGameObjectsWithEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
|
||||
bool operator() (GameObject* go)
|
||||
{
|
||||
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;
|
||||
@@ -1267,7 +1267,7 @@ namespace Trinity
|
||||
AllCreaturesOfEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
|
||||
bool operator() (Unit* unit)
|
||||
{
|
||||
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