Skip to content

Commit

Permalink
ignore locked statics in taskDefend (#1016)
Browse files Browse the repository at this point in the history
* check locked statics

* checked locked statics in waypoint garrison
  • Loading branch information
Cuel authored and commy2 committed Oct 23, 2018
1 parent 6296756 commit 994c674
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addons/ai/fnc_taskDefend.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private _statics = _position nearObjects ["StaticWeapon", _radius];
private _buildings = _position nearObjects ["Building", _radius];

// Filter out occupied statics
_statics = _statics select {(_x emptyPositions "Gunner") > 0};
_statics = _statics select {locked _x != 2 && {(_x emptyPositions "Gunner") > 0}};

// Filter out buildings below the size threshold (and store positions for later use)
_buildings = _buildings select {
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 @@ -30,7 +30,7 @@ params ["_group", "_position"];
// leader should not issue attack orders
_group enableAttack false;

private _staticWeapons = _position nearObjects ["StaticWeapon", 50] select {_x emptyPositions "gunner" > 0};
private _staticWeapons = _position nearObjects ["StaticWeapon", 50] select {locked _x != 2 && {_x emptyPositions "gunner" > 0}};
private _buildings = (_position nearObjects ["Building", 50]) apply {_x buildingPos -1} select {count _x > 0};

{
Expand Down

0 comments on commit 994c674

Please sign in to comment.