mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Merge pull request #566 from EricksOliveira/patch-2
Update PlayerbotAI.cpp
This commit is contained in:
commit
d64e65d8f6
@ -355,15 +355,18 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
|
||||
return;
|
||||
|
||||
if (!bot->InBattleground() && !bot->inRandomLfgDungeon() && bot->GetGroup())
|
||||
{
|
||||
Player* leader = bot->GetGroup()->GetLeader();
|
||||
PlayerbotAI* leaderAI = GET_PLAYERBOT_AI(leader);
|
||||
if (leaderAI && !leaderAI->IsRealPlayer())
|
||||
{
|
||||
bot->RemoveFromGroup();
|
||||
ResetStrategies();
|
||||
}
|
||||
}
|
||||
{
|
||||
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())
|
||||
{
|
||||
bot->RemoveFromGroup();
|
||||
ResetStrategies();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool min = minimal;
|
||||
UpdateAIInternal(elapsed, min);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user