feat(Core/AI): Implement DoForAllSummons() function to summon lists (#15262)

This commit is contained in:
Skjalf
2023-03-07 05:32:53 -03:00
committed by GitHub
parent 850dfb9320
commit 86a2e94746

View File

@@ -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;