Scripts/Icecrown Citadel: Prevent possible issues if less than 4 triggers are hit by Ooze Flood
This commit is contained in:
@@ -434,6 +434,7 @@ class spell_rotface_ooze_flood : public SpellScriptLoader
|
|||||||
{
|
{
|
||||||
if (!GetHitUnit())
|
if (!GetHitUnit())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::list<Creature*> list;
|
std::list<Creature*> list;
|
||||||
GetHitUnit()->GetCreatureListWithEntryInGrid(list, GetHitUnit()->GetEntry(), 12.5f);
|
GetHitUnit()->GetCreatureListWithEntryInGrid(list, GetHitUnit()->GetEntry(), 12.5f);
|
||||||
list.sort(Trinity::ObjectDistanceOrderPred(GetHitUnit()));
|
list.sort(Trinity::ObjectDistanceOrderPred(GetHitUnit()));
|
||||||
@@ -444,7 +445,11 @@ class spell_rotface_ooze_flood : public SpellScriptLoader
|
|||||||
{
|
{
|
||||||
// get 2 targets except 2 nearest
|
// get 2 targets except 2 nearest
|
||||||
targetList.sort(Trinity::ObjectDistanceOrderPred(GetCaster()));
|
targetList.sort(Trinity::ObjectDistanceOrderPred(GetCaster()));
|
||||||
|
|
||||||
|
// .resize() runs pop_back();
|
||||||
|
if (targetList.size() > 4)
|
||||||
targetList.resize(4);
|
targetList.resize(4);
|
||||||
|
|
||||||
while (targetList.size() > 2)
|
while (targetList.size() > 2)
|
||||||
targetList.pop_front();
|
targetList.pop_front();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user