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

optimize default value for radius in CBA_fnc_addWaypoint etc. #1277

Merged
merged 5 commits into from
Jan 11, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion addons/ai/fnc_addWaypoint.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Author:
params [
"_group",
"_position",
["_radius", 0, [0]],
["_radius", -1, [0]],
["_type", "MOVE", [""]],
["_behaviour", "UNCHANGED", [""]],
["_combat", "NO CHANGE", [""]],
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/fnc_clearWaypoints.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ private _waypoints = waypoints _group;
} 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];
private _wp = _group addWaypoint [getPosATL (leader _group), -1];
_wp setWaypointStatements ["true", "deleteWaypoint [group this,currentWaypoint (group this)]"];
2 changes: 1 addition & 1 deletion addons/ai/fnc_searchNearby.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if ((leader _group) distanceSqr _building > 250e3) exitwith {};

// Add a waypoint to regroup after the search
_group lockWP true;
private _wp = _group addWaypoint [getPos _leader, 0, currentWaypoint _group];
private _wp = _group addWaypoint [getPos _leader, -1, currentWaypoint _group];
private _cond = "({unitReady _x || !(alive _x)} count thisList) == count thisList";
private _comp = format ["this setFormation '%1'; this setBehaviour '%2'; deleteWaypoint [group this, currentWaypoint (group this)];", formation _group, behaviour _leader];
_wp setWaypointStatements [_cond, _comp];
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/fnc_taskAttack.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Author:

---------------------------------------------------------------------------- */

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

_group = _group call CBA_fnc_getGroup;
if !(local _group) exitWith {}; // Don't create waypoints on each machine
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/fnc_taskPatrol.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ _position = _position call CBA_fnc_getPos;

// Can pass parameters straight through to addWaypoint
_this =+ _this;
_this set [2,0];
_this set [2,-1];
if (count _this > 3) then {
_this deleteAt 3;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/fnc_taskSearchArea.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ _onComplete = _statements joinString ";";
[
_group,
_pos,
0,
-1,
"MOVE",
_behaviour,
_combat,
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/fnc_waypointGarrison.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Returns:

Examples:
(begin example)
_group addWaypoint [_position, 0] setWaypointScript "\x\cba\addons\ai\fnc_waypointGarrison.sqf []";
_group addWaypoint [_position, -1] setWaypointScript "\x\cba\addons\ai\fnc_waypointGarrison.sqf []";

[_group, _position] execVM "\x\cba\addons\ai\fnc_waypointGarrison.sqf";
(end)
Expand Down