Merge pull request #566 from EricksOliveira/patch-2

Update PlayerbotAI.cpp
This commit is contained in:
Yunfan Li 2024-10-03 12:24:46 +08:00 committed by GitHub
commit d64e65d8f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -357,6 +357,8 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
if (!bot->InBattleground() && !bot->inRandomLfgDungeon() && bot->GetGroup())
{
Player* leader = bot->GetGroup()->GetLeader();
if (leader && leader != bot) // Checks if the leader is valid and is not the bot itself
{
PlayerbotAI* leaderAI = GET_PLAYERBOT_AI(leader);
if (leaderAI && !leaderAI->IsRealPlayer())
{
@ -364,6 +366,7 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
ResetStrategies();
}
}
}
bool min = minimal;
UpdateAIInternal(elapsed, min);