fix(Core/AI): possible "self interrupts" in BossAI::ExecuteEvent calls (#8654)

This commit is contained in:
Andrius Peleckas
2021-10-22 14:36:07 +03:00
committed by GitHub
parent b0d4f1917e
commit 9bcde70dab

View File

@@ -622,15 +622,25 @@ void BossAI::SummonedCreatureDespawnAll()
void BossAI::UpdateAI(uint32 diff)
{
if (!UpdateVictim())
{
return;
}
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
{
return;
}
while (uint32 eventId = events.ExecuteEvent())
while (uint32 const eventId = events.ExecuteEvent())
{
ExecuteEvent(eventId);
if (me->HasUnitState(UNIT_STATE_CASTING))
{
return;
}
}
DoMeleeAttackIfReady();
}