diff options
author | Shauren <shauren.trinity@gmail.com> | 2011-04-22 17:28:11 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2011-04-22 17:28:11 +0200 |
commit | 2e21e9792f1c316988de018be8df921869b6af38 (patch) | |
tree | 398ead0a2e58d187cf12cbf91d889bd46f7f15cd | |
parent | 40cb0718c2cbcba3eda73bae4500c882b4604b26 (diff) |
Scripts/Icecrown Citadel: Prevent possible issues if less than 4 triggers are hit by Ooze Flood
-rw-r--r-- | src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index 51060932f56..809c6cecbf7 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -434,6 +434,7 @@ class spell_rotface_ooze_flood : public SpellScriptLoader { if (!GetHitUnit()) return; + std::list<Creature*> list; GetHitUnit()->GetCreatureListWithEntryInGrid(list, GetHitUnit()->GetEntry(), 12.5f); list.sort(Trinity::ObjectDistanceOrderPred(GetHitUnit())); @@ -444,7 +445,11 @@ class spell_rotface_ooze_flood : public SpellScriptLoader { // get 2 targets except 2 nearest targetList.sort(Trinity::ObjectDistanceOrderPred(GetCaster())); - targetList.resize(4); + + // .resize() runs pop_back(); + if (targetList.size() > 4) + targetList.resize(4); + while (targetList.size() > 2) targetList.pop_front(); } |