mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
feat(Core/AI): Implement DoForAllSummons() function to summon lists (#15262)
This commit is contained in:
@@ -139,6 +139,20 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void DoForAllSummons(std::function<void(WorldObject*)> exec)
|
||||
{
|
||||
// We need to use a copy of SummonList here, otherwise original SummonList would be modified
|
||||
StorageType listCopy = storage_;
|
||||
|
||||
for (auto const& guid : listCopy)
|
||||
{
|
||||
if (WorldObject* summon = ObjectAccessor::GetWorldObject(*me, guid))
|
||||
{
|
||||
exec(summon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DoZoneInCombat(uint32 entry = 0);
|
||||
void RemoveNotExisting();
|
||||
bool HasEntry(uint32 entry) const;
|
||||
|
||||
Reference in New Issue
Block a user