mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
fix(Core/Pooling): Fixed less and less objects from pools being spawned the longer the server is running (#5572)
This commit is contained in:
@@ -261,7 +261,7 @@ public:
|
||||
targetList.reverse();
|
||||
|
||||
if (targetType == SELECT_TARGET_RANDOM)
|
||||
acore::Containers::RandomResizeList(targetList, maxTargets);
|
||||
acore::Containers::RandomResize(targetList, maxTargets);
|
||||
else
|
||||
targetList.resize(maxTargets);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
|
||||
// We need to use a copy of SummonList here, otherwise original SummonList would be modified
|
||||
StorageType listCopy = storage_;
|
||||
acore::Containers::RandomResizeList<ObjectGuid, Predicate>(listCopy, predicate, max);
|
||||
acore::Containers::RandomResize(listCopy, predicate, max);
|
||||
for (StorageType::iterator i = listCopy.begin(); i != listCopy.end(); ++i)
|
||||
{
|
||||
Creature* summon = ObjectAccessor::GetCreature(*me, *i);
|
||||
|
||||
@@ -734,7 +734,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
caster = unit->SummonTrigger(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetOrientation(), 5000);
|
||||
|
||||
if (e.action.cast.targetsLimit > 0 && targets->size() > e.action.cast.targetsLimit)
|
||||
acore::Containers::RandomResizeList(*targets, e.action.cast.targetsLimit);
|
||||
acore::Containers::RandomResize(*targets, e.action.cast.targetsLimit);
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
@@ -793,7 +793,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
break;
|
||||
|
||||
if (e.action.cast.targetsLimit > 0 && targets->size() > e.action.cast.targetsLimit)
|
||||
acore::Containers::RandomResizeList(*targets, e.action.cast.targetsLimit);
|
||||
acore::Containers::RandomResize(*targets, e.action.cast.targetsLimit);
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
@@ -3680,7 +3680,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
l->push_back(*itr);
|
||||
|
||||
if (e.target.playerRange.maxCount > 0)
|
||||
acore::Containers::RandomResizeList(*l, e.target.playerRange.maxCount);
|
||||
acore::Containers::RandomResize(*l, e.target.playerRange.maxCount);
|
||||
}
|
||||
|
||||
delete units;
|
||||
@@ -3800,7 +3800,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
l->push_back(*itr);
|
||||
|
||||
if (e.target.o > 0)
|
||||
acore::Containers::RandomResizeList(*l, e.target.o);
|
||||
acore::Containers::RandomResize(*l, e.target.o);
|
||||
|
||||
delete units;
|
||||
break;
|
||||
@@ -3842,7 +3842,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
}
|
||||
|
||||
if (e.target.roleSelection.resize > 0)
|
||||
acore::Containers::RandomResizeList(*l, e.target.roleSelection.resize);
|
||||
acore::Containers::RandomResize(*l, e.target.roleSelection.resize);
|
||||
|
||||
delete units;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user