mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
fix(Core/Travel): Use GetGroupLeader()==bot instead of nonexistent IsGroupLeader
This commit is contained in:
parent
c586f141a8
commit
0f612ab7a5
@ -1435,12 +1435,13 @@ TravelNodeRoute TravelNodeMap::GetNodeRoute(TravelNode* start, TravelNode* goal,
|
|||||||
// group members — a taxi/transport edge the leader
|
// group members — a taxi/transport edge the leader
|
||||||
// can afford but a member can't would split the group.
|
// can afford but a member can't would split the group.
|
||||||
startStub->currentGold = AI_VALUE2(uint32, "free money for", (uint32)NeedMoneyFor::travel);
|
startStub->currentGold = AI_VALUE2(uint32, "free money for", (uint32)NeedMoneyFor::travel);
|
||||||
|
bool const isLeader = botAI->GetGroupLeader() == bot;
|
||||||
for (ObjectGuid guid : AI_VALUE(GuidVector, "group members"))
|
for (ObjectGuid guid : AI_VALUE(GuidVector, "group members"))
|
||||||
{
|
{
|
||||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||||
if (!player)
|
if (!player)
|
||||||
continue;
|
continue;
|
||||||
if (!botAI->IsGroupLeader() && player != bot)
|
if (!isLeader && player != bot)
|
||||||
continue;
|
continue;
|
||||||
if (!botAI->IsSafe(player))
|
if (!botAI->IsSafe(player))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user