Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add override capability to fnc_taskAttack #356

Merged
merged 5 commits into from
Jun 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion addons/ai/fnc_taskAttack.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Parameters:

Optional:
- Search Radius (Scalar)
- Remove Assigned Waypoints (Bool)

Example:
(begin example)
Expand All @@ -26,9 +27,14 @@ Author:

#include "script_component.hpp"

params ["_group","_position", ["_radius",0]];
params ["_group","_position", ["_radius",0], ["_override",false]];

_group = _group call CBA_fnc_getGroup;
if !(local _group) exitWith {}; // Don't create waypoints on each machine

// Allow TaskAttack to override other set waypoints
if (_override) then {
[_group] call CBA_fnc_clearWaypoints;
};

[_group, _position, _radius, "SAD", "COMBAT", "RED"] call CBA_fnc_addWaypoint;