mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 00:08:01 +00:00
fix(Core/AI): possible "self interrupts" in BossAI::ExecuteEvent calls (#8654)
This commit is contained in:
@@ -622,15 +622,25 @@ void BossAI::SummonedCreatureDespawnAll()
|
|||||||
void BossAI::UpdateAI(uint32 diff)
|
void BossAI::UpdateAI(uint32 diff)
|
||||||
{
|
{
|
||||||
if (!UpdateVictim())
|
if (!UpdateVictim())
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
events.Update(diff);
|
events.Update(diff);
|
||||||
|
|
||||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
while (uint32 eventId = events.ExecuteEvent())
|
while (uint32 const eventId = events.ExecuteEvent())
|
||||||
|
{
|
||||||
ExecuteEvent(eventId);
|
ExecuteEvent(eventId);
|
||||||
|
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user