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

(cherry picked from commit a23ccc1b83)
This commit is contained in:
treeston
2016-02-12 12:18:17 +01:00
committed by Shauren
parent d0dce8c8dd
commit dc07c24c0c

View File

@@ -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