From b2dae08221805246df2a5ab8b3267bd6472c40ab Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sun, 6 Oct 2024 12:21:33 +0800 Subject: [PATCH] [Performance] Pull up CanUpdateAI() check --- src/PlayerbotAI.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index 1200e050..a8c7e8c0 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);