mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Remove from group when no real player in lfg group
This commit is contained in:
parent
01c257005e
commit
d3868e7af7
@ -406,6 +406,27 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bot->GetGroup() && bot->GetGroup()->isLFGGroup())
|
||||||
|
{
|
||||||
|
bool hasRealPlayer = false;
|
||||||
|
for (GroupReference* ref = bot->GetGroup()->GetFirstMember(); ref; ref = ref->next())
|
||||||
|
{
|
||||||
|
Player* member = ref->GetSource();
|
||||||
|
if (!member)
|
||||||
|
continue;
|
||||||
|
PlayerbotAI* memberAI = GET_PLAYERBOT_AI(member);
|
||||||
|
if (memberAI && !memberAI->IsRealPlayer())
|
||||||
|
continue;
|
||||||
|
hasRealPlayer = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!hasRealPlayer)
|
||||||
|
{
|
||||||
|
bot->RemoveFromGroup();
|
||||||
|
ResetStrategies();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool min = minimal;
|
bool min = minimal;
|
||||||
UpdateAIInternal(elapsed, min);
|
UpdateAIInternal(elapsed, min);
|
||||||
YieldThread(GetReactDelay());
|
YieldThread(GetReactDelay());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user