Skip to content

Commit

Permalink
Merge pull request #1274 from Vdauphin/clearWaypoints_emptyGroup_case
Browse files Browse the repository at this point in the history
AI: Don't halt planned movement for empty group
  • Loading branch information
commy2 committed Jan 17, 2020
2 parents 5a80746 + 4bd293c commit 0c8607d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions addons/ai/fnc_clearWaypoints.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ private _waypoints = waypoints _group;
deleteWaypoint [_group, 0];
} forEach _waypoints;

// Create a self-deleting waypoint at the leader position to halt all planned movement (based on old waypoints)
private _wp = _group addWaypoint [getPosATL (leader _group), -1];
_wp setWaypointStatements ["true", "deleteWaypoint [group this,currentWaypoint (group this)]"];
if !(units _group isEqualTo []) then {
// Create a self-deleting waypoint at the leader position to halt all planned movement (based on old waypoints)
private _wp = _group addWaypoint [getPosATL (leader _group), -1];
_wp setWaypointStatements ["true", "deleteWaypoint [group this,currentWaypoint (group this)]"];
};

0 comments on commit 0c8607d

Please sign in to comment.