diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index 0656e721..68512241 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -314,6 +314,10 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal) AllowActivity(); + + if (!CanUpdateAI()) + return; + Spell* currentSpell = bot->GetCurrentSpell(CURRENT_GENERIC_SPELL); if (!currentSpell) currentSpell = bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL); @@ -356,6 +360,7 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal) } // wait for spell cast + YieldThread(GetReactDelay()); return; } @@ -382,9 +387,6 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal) bot->StopMovingOnCurrentPos(); } } - - if (!CanUpdateAI()) - return; if (!bot->InBattleground() && !bot->inRandomLfgDungeon() && bot->GetGroup()) {