Scripts/Events: Globally fix all ExecuteEvent loops to check UNIT_STATE_CASTING after each iteration, instead of just checking it once initially.

Fixes and closes #17892.

(cherry picked from commit ac62d7156f93bf86f57dbad1f24f14031322fd5a)

Drycoding is bad, mmkay?
(cherry picked from commit ed83a35fbeeb7f9005fe4792225fb50700791c6f)
This commit is contained in:
treeston
2017-02-19 15:09:02 +01:00
committed by joschiwald
parent 5654fb9343
commit dd0df772df
150 changed files with 617 additions and 3 deletions
@@ -539,7 +539,11 @@ void BossAI::UpdateAI(uint32 diff)
return;
while (uint32 eventId = events.ExecuteEvent())
{
ExecuteEvent(eventId);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoMeleeAttackIfReady();
}
@@ -620,7 +624,11 @@ void WorldBossAI::UpdateAI(uint32 diff)
return;
while (uint32 eventId = events.ExecuteEvent())
{
ExecuteEvent(eventId);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoMeleeAttackIfReady();
}