mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +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:
@@ -420,7 +420,7 @@ public:
|
||||
if (Player* p = itr->GetSource())
|
||||
if (p->IsAlive() && p != me->GetVictim() && p->GetGUID() != _offtankGUID && !p->IsGameMaster() && p->GetDistance(me) < 100.0f && !p->HasAura(SPELL_UNCONTROLLABLE_FRENZY))
|
||||
myList.push_back(p);
|
||||
acore::Containers::RandomResizeList(myList, Is25ManRaid() ? 3 : 2);
|
||||
acore::Containers::RandomResize(myList, Is25ManRaid() ? 3 : 2);
|
||||
if (myList.size() > 1)
|
||||
{
|
||||
Talk(SAY_PACT_OF_THE_DARKFALLEN);
|
||||
@@ -446,7 +446,7 @@ public:
|
||||
|
||||
if (!myList.empty())
|
||||
{
|
||||
acore::Containers::RandomResizeList(myList, 1);
|
||||
acore::Containers::RandomResize(myList, 1);
|
||||
Player* target = myList.front();
|
||||
Talk(EMOTE_SWARMING_SHADOWS, target);
|
||||
Talk(SAY_SWARMING_SHADOWS);
|
||||
@@ -468,7 +468,7 @@ public:
|
||||
if (p->IsAlive() && p != me->GetVictim() && p->GetGUID() != _offtankGUID && !p->IsGameMaster() && !p->HasAura(SPELL_PACT_OF_THE_DARKFALLEN) && !p->HasAura(SPELL_UNCONTROLLABLE_FRENZY))
|
||||
myList.push_back(p);
|
||||
|
||||
acore::Containers::RandomResizeList<Player*>(myList, uint32(Is25ManRaid() ? 4 : 2));
|
||||
acore::Containers::RandomResize(myList, uint32(Is25ManRaid() ? 4 : 2));
|
||||
for (std::list<Player*>::iterator itr = myList.begin(); itr != myList.end(); ++itr)
|
||||
me->CastSpell(*itr, SPELL_TWILIGHT_BLOODBOLT, false);
|
||||
me->CastSpell(me, SPELL_TWILIGHT_BLOODBOLT_TARGET, false);
|
||||
@@ -723,7 +723,7 @@ public:
|
||||
{
|
||||
uint32 targetCount = (targets.size() + 2) / 3;
|
||||
targets.remove_if(BloodboltHitCheck(static_cast<LanaThelAI*>(GetCaster()->GetAI())));
|
||||
acore::Containers::RandomResizeList(targets, targetCount);
|
||||
acore::Containers::RandomResize(targets, targetCount);
|
||||
// mark targets now, effect hook has missile travel time delay (might cast next in that time)
|
||||
for (std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
GetCaster()->GetAI()->SetGUID((*itr)->GetGUID(), GUID_BLOODBOLT);
|
||||
|
||||
@@ -1315,7 +1315,7 @@ public:
|
||||
targets.push_back(target);
|
||||
}
|
||||
else
|
||||
acore::Containers::RandomResizeList(targets, 3);
|
||||
acore::Containers::RandomResize(targets, 3);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -2208,7 +2208,7 @@ public:
|
||||
void SelectTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(IgbExplosionCheck(GetCaster()));
|
||||
acore::Containers::RandomResizeList(targets, 1);
|
||||
acore::Containers::RandomResize(targets, 1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -1257,7 +1257,7 @@ public:
|
||||
}
|
||||
|
||||
targets.remove_if(acore::UnitAuraCheck(true, sSpellMgr->GetSpellIdForDifficulty(SPELL_UNBOUND_PLAGUE, GetCaster())));
|
||||
acore::Containers::RandomResizeList(targets, 1);
|
||||
acore::Containers::RandomResize(targets, 1);
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
|
||||
@@ -908,10 +908,10 @@ public:
|
||||
uint32 maxSize = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 3 : 1);
|
||||
healList.remove_if(UnchainedMagicTargetSelector(false));
|
||||
if (healList.size() > maxSize)
|
||||
acore::Containers::RandomResizeList(healList, maxSize);
|
||||
acore::Containers::RandomResize(healList, maxSize);
|
||||
dpsList.remove_if(UnchainedMagicTargetSelector(true));
|
||||
if (dpsList.size() > maxSize)
|
||||
acore::Containers::RandomResizeList(dpsList, maxSize);
|
||||
acore::Containers::RandomResize(dpsList, maxSize);
|
||||
unitList.splice(unitList.begin(), healList);
|
||||
unitList.splice(unitList.begin(), dpsList);
|
||||
}
|
||||
|
||||
@@ -1368,7 +1368,7 @@ public:
|
||||
return;
|
||||
summoners = list_copy;
|
||||
}
|
||||
acore::Containers::RandomResizeList(summoners, 2);
|
||||
acore::Containers::RandomResize(summoners, 2);
|
||||
|
||||
for (uint32 i = 0; i < 3; ++i)
|
||||
caster->CastSpell(summoners.front(), SPELL_SUMMON_SUPPRESSER, true);
|
||||
|
||||
@@ -2159,7 +2159,7 @@ public:
|
||||
void RemoveAliveTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(AliveCheck());
|
||||
acore::Containers::RandomResizeList(targets, 2);
|
||||
acore::Containers::RandomResize(targets, 2);
|
||||
}
|
||||
|
||||
void Land(SpellEffIndex /*effIndex*/)
|
||||
|
||||
@@ -426,7 +426,7 @@ public:
|
||||
targets.push_back(itr->GetSource());
|
||||
targets.remove_if(acore::ObjectTypeIdCheck(TYPEID_PLAYER, false));
|
||||
targets.remove_if(acore::UnitAuraCheck(true, SPELL_FLASH_FREEZE_TRAPPED_PLAYER));
|
||||
acore::Containers::RandomResizeList(targets, (RAID_MODE(2,3)));
|
||||
acore::Containers::RandomResize(targets, (RAID_MODE(2,3)));
|
||||
for (std::list<Unit*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
{
|
||||
float prevZ = (*itr)->GetPositionZ();
|
||||
@@ -1273,7 +1273,7 @@ public:
|
||||
{
|
||||
targets.remove_if(acore::ObjectTypeIdCheck(TYPEID_PLAYER, false));
|
||||
targets.remove_if(acore::UnitAuraCheck(true, SPELL_FLASH_FREEZE_TRAPPED_PLAYER));
|
||||
acore::Containers::RandomResizeList(targets, 1);
|
||||
acore::Containers::RandomResize(targets, 1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -1193,7 +1193,7 @@ public:
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(GhoulTargetCheck(GetSpellInfo()->Id == 70790));
|
||||
acore::Containers::RandomResizeList(targets, 2);
|
||||
acore::Containers::RandomResize(targets, 2);
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
|
||||
Reference in New Issue
Block a user