mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Merge pull request #583 from liyunfan1223/update_optimize
[Performance] Update optimize
This commit is contained in:
@@ -314,6 +314,10 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
|
|||||||
|
|
||||||
AllowActivity();
|
AllowActivity();
|
||||||
|
|
||||||
|
|
||||||
|
if (!CanUpdateAI())
|
||||||
|
return;
|
||||||
|
|
||||||
Spell* currentSpell = bot->GetCurrentSpell(CURRENT_GENERIC_SPELL);
|
Spell* currentSpell = bot->GetCurrentSpell(CURRENT_GENERIC_SPELL);
|
||||||
if (!currentSpell)
|
if (!currentSpell)
|
||||||
currentSpell = bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL);
|
currentSpell = bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL);
|
||||||
@@ -356,6 +360,7 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// wait for spell cast
|
// wait for spell cast
|
||||||
|
YieldThread(GetReactDelay());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,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())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user