Skip to content

Commit 11a0521

Browse files
committed
(hopefully) more pathing fixes to avoid idle actors, and fix squads
1 parent 7c75cd9 commit 11a0521

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Source/Activities/GameActivity.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,7 @@ void GameActivity::Update() {
14361436
pActor->ClearAIWaypoints();
14371437
pActor->SetAIMode(Actor::AIMODE_SQUAD);
14381438
pActor->AddAIMOWaypoint(m_ControlledActor[player]);
1439+
pActor->SetMovePathToUpdate();
14391440
}
14401441
}
14411442

Source/Entities/Activity.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,8 @@ void Activity::ReassignSquadLeader(const int player, const int team) {
682682
if (actor && (actor->GetAIMode() == Actor::AIMODE_SQUAD) && (actor->GetAIMOWaypointID() == leaderID) && !actor->GetController()->IsPlayerControlled() && !actor->IsInGroup("Brains")) {
683683
actor->ClearAIWaypoints();
684684
actor->AddAIMOWaypoint(m_ControlledActor[player]);
685+
// Make sure actor has m_ControlledActor registered as an AIMOWaypoint
686+
actor->SetMovePathToUpdate();
685687
} else if (actor && actor->GetID() == leaderID) {
686688
// Set the old leader to follow the controlled actor and inherit his AI mode
687689
m_ControlledActor[player]->ClearAIWaypoints();
@@ -701,6 +703,7 @@ void Activity::ReassignSquadLeader(const int player, const int team) {
701703
actor->ClearAIWaypoints();
702704
actor->SetAIMode(Actor::AIMODE_SQUAD);
703705
actor->AddAIMOWaypoint(m_ControlledActor[player]);
706+
actor->SetMovePathToUpdate();
704707
}
705708
actor = g_MovableMan.GetNextTeamActor(team, actor);
706709
} while (actor && actor != m_ControlledActor[player]);

0 commit comments

Comments
 (0)