mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 03:42:37 +01:00
Core/Shared: Move container functions to shared project under Trinity::Container namespace. Also implement RandomResizeList which takes a predicate function as parameter.
Core/ScriptedAI: Extend SummonList::DoAction to take a predicate function as parameter and allow specifying a maximum number of units to be selected.
This commit is contained in:
@@ -479,7 +479,7 @@ void PoolGroup<Quest>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32
|
||||
{
|
||||
do
|
||||
{
|
||||
uint32 questId = SelectRandomContainerElement(currentQuests);
|
||||
uint32 questId = Trinity::Containers::SelectRandomContainerElement(currentQuests);
|
||||
newQuests.insert(questId);
|
||||
currentQuests.erase(questId);
|
||||
} while (newQuests.size() < limit && !currentQuests.empty()); // failsafe
|
||||
@@ -491,7 +491,7 @@ void PoolGroup<Quest>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32
|
||||
// activate <limit> random quests
|
||||
do
|
||||
{
|
||||
uint32 questId = SelectRandomContainerElement(newQuests);
|
||||
uint32 questId = Trinity::Containers::SelectRandomContainerElement(newQuests);
|
||||
spawns.ActivateObject<Quest>(questId, poolId);
|
||||
PoolObject tempObj(questId, 0.0f);
|
||||
Spawn1Object(&tempObj);
|
||||
|
||||
Reference in New Issue
Block a user