-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #333 from SilentSpike/master
Update AI functions
- Loading branch information
Showing
6 changed files
with
189 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_clearWaypoints | ||
Description: | ||
A function used to correctly clear all waypoints from a group. | ||
Parameters: | ||
- Group (Group or Object) | ||
Example: | ||
(begin example) | ||
[group player] call CBA_fnc_clearWaypoints | ||
(end) | ||
Returns: | ||
None | ||
Author: | ||
SilentSpike | ||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
params [["_group", grpNull, [grpNull,objNull]]]; | ||
_group = _group call CBA_fnc_getGroup; | ||
|
||
private _waypoints = waypoints _group; | ||
{ | ||
// Waypoint index changes with each deletion, so don't delete _x | ||
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), 0]; | ||
_wp setWaypointStatements ["true", "deleteWaypoint [group this,currentWaypoint (group this)]"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.