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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user