[Performance] YieldThread when casting spell

This commit is contained in:
Yunfan Li
2024-10-06 12:22:48 +08:00
parent b2dae08221
commit 69ef0d46cd

View File

@@ -360,6 +360,7 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
} }
// wait for spell cast // wait for spell cast
YieldThread(GetReactDelay());
return; return;
} }
@@ -386,9 +387,6 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
bot->StopMovingOnCurrentPos(); bot->StopMovingOnCurrentPos();
} }
} }
if (!CanUpdateAI())
return;
if (!bot->InBattleground() && !bot->inRandomLfgDungeon() && bot->GetGroup()) if (!bot->InBattleground() && !bot->inRandomLfgDungeon() && bot->GetGroup())
{ {