Skip to content

Commit

Permalink
Merge pull request #367 from CBATeam/fix-search-nearby
Browse files Browse the repository at this point in the history
Add quotes around setFormation/Behaviour params. Fixes #366
  • Loading branch information
Killswitch00 committed Jun 6, 2016
2 parents 56413ab + 524354a commit 8ea6433
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/ai/fnc_searchNearby.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ Author:
---------------------------------------------------------------------------- */

params ["_group"];

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

private _building = nearestBuilding (leader _group);
if ((leader _group) distanceSqr _building > 250e3) exitwith {};
Expand All @@ -34,7 +36,7 @@ if ((leader _group) distanceSqr _building > 250e3) exitwith {};
_group lockWP true;
private _wp = _group addWaypoint [getPos _leader, 0, 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];
private _comp = format ["this setFormation '%1'; this setBehaviour '%2'; deleteWaypoint [group this, currentWaypoint (group this)];",formation _group,behaviour _leader];
_wp setWaypointStatements [_cond,_comp];

// Prepare group to search
Expand Down

0 comments on commit 8ea6433

Please sign in to comment.