Scripts/Naxxramas: Fix an edge case crash in Gothik. Closes #16575.

(cherry picked from commit a23ccc1b83ded39501d690e288be49be8f32b539)
This commit is contained in:
treeston
2016-04-10 14:39:32 +02:00
committed by Shauren
parent d0dce8c8dd
commit dc07c24c0c
@@ -369,8 +369,12 @@ class boss_gothik : public CreatureScript
_gateIsOpen = true;
for (ObjectGuid summonGuid : summons)
{
if (Creature* summon = ObjectAccessor::GetCreature(*me, summonGuid))
summon->AI()->DoAction(ACTION_GATE_OPENED);
if (summons.empty()) // ACTION_GATE_OPENED may cause an evade, despawning summons and invalidating our iterator
break;
}
}
void DamageTaken(Unit* /*who*/, uint32& damage) override