Scripts/Icecrown Citadel: Fixed crash in spell_frostwarden_handler_order_whelp
Closes #5129
This commit is contained in:
@@ -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);
|
||||
@@ -1358,6 +1361,9 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader
|
||||
if (Creature* creature = GetCaster()->ToCreature())
|
||||
unitList.remove_if(OrderWhelpTargetSelector(creature));
|
||||
|
||||
if (unitList.empty())
|
||||
return;
|
||||
|
||||
SelectRandomContainerElement(unitList)->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user