Skip to content

Commit

Permalink
Follow master instead of group master in formation
Browse files Browse the repository at this point in the history
  • Loading branch information
liyunfan1223 committed Jan 4, 2025
1 parent a5787a0 commit 9293e5b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/strategy/values/Formations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ bool Formation::IsNullLocation(WorldLocation const& loc) { return IsSameLocation

WorldLocation MoveAheadFormation::GetLocation()
{
Player* master = botAI->GetGroupMaster();
Player* master = GetMaster();
if (!master || master == bot)
return WorldLocation();

Expand Down Expand Up @@ -110,7 +110,7 @@ class ChaosFormation : public MoveAheadFormation

WorldLocation GetLocationInternal() override
{
Player* master = botAI->GetGroupMaster();
Player* master = GetMaster();
if (!master)
return WorldLocation();

Expand All @@ -120,7 +120,7 @@ class ChaosFormation : public MoveAheadFormation
time_t now = time(nullptr);
if (!lastChangeTime || now - lastChangeTime >= 3)
{
Player* master = botAI->GetGroupMaster();
Player* master = GetMaster();
if (!master)
return WorldLocation();

Expand Down Expand Up @@ -185,7 +185,7 @@ class CircleFormation : public MoveFormation
float range = 2.0f;

Unit* target = AI_VALUE(Unit*, "current target");
Player* master = botAI->GetGroupMaster();
Player* master = GetMaster();
if (!target && target != bot)
target = master;

Expand Down Expand Up @@ -239,7 +239,7 @@ class LineFormation : public MoveAheadFormation

float range = 2.0f;

Player* master = botAI->GetGroupMaster();
Player* master = GetMaster();
if (!master)
return Formation::NullLocation;

Expand Down

0 comments on commit 9293e5b

Please sign in to comment.