diff options
author | Shauren <shauren.trinity@gmail.com> | 2012-02-10 16:40:02 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2012-02-10 16:40:02 +0100 |
commit | 9155d21b649589df729b1a5a0f4828678059f7dd (patch) | |
tree | 9fc812d695c1be61dbc06a411d93ed6fa61e7e4f /src | |
parent | 6a43ee550190ae34da7eda0225a5ac4937168d04 (diff) |
Scripts/Icecrown Citadel: Fixed crash in spell_frostwarden_handler_order_whelp
Closes #5129
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index fb04d9ce7a4..6bbc028e90c 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1344,6 +1344,9 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader ++itr; } + if (unitList.empty()) + return; + Unit* target = SelectRandomContainerElement(unitList); unitList.clear(); unitList.push_back(target); @@ -1356,7 +1359,10 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader std::list<Creature*> unitList; GetCreatureListWithEntryInGrid(unitList, GetCaster(), NPC_FROSTWING_WHELP, 150.0f); if (Creature* creature = GetCaster()->ToCreature()) - unitList.remove_if (OrderWhelpTargetSelector(creature)); + unitList.remove_if(OrderWhelpTargetSelector(creature)); + + if (unitList.empty()) + return; SelectRandomContainerElement(unitList)->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true); } |