Skip to content

Commit

Permalink
Use allUnits with filter over nearestObjects for Intel
Browse files Browse the repository at this point in the history
  • Loading branch information
theace0296 committed Dec 4, 2021
1 parent dc8eb43 commit fd21a92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RandFramework/Global/common/fn_showIntel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if (_IntelToShow isEqualTo 0 || !_showIntel) exitWith { //Nothing found
missionNamespace setVariable [format ["TRGM_VAR_IntelFound_%1", _iTaskIndex], _IntelFound + [_IntelToShow], true];

if (_IntelToShow isEqualTo 1) exitWith { //Mortor team location
private _IntelShowPos = nearestObjects [TRGM_VAR_ObjectivePositions select _iTaskIndex,(call sMortar) + (call sMortarMilitia),3000];
private _IntelShowPos = allUnits select { (typeof _x) in ((call sMortar) + (call sMortarMilitia)) && { (_x distance2D (TRGM_VAR_ObjectivePositions select _iTaskIndex)) < 3000 }; };
private _iCount = count _IntelShowPos;
if (_iCount > 0) then {
{
Expand All @@ -78,7 +78,7 @@ if (_IntelToShow isEqualTo 1) exitWith { //Mortor team location
};
};
if (_IntelToShow isEqualTo 2) exitWith { //AAA team location
private _IntelShowPos = nearestObjects [TRGM_VAR_ObjectivePositions select _iTaskIndex,[(call sAAAVeh)] + [(call sAAAVehMilitia)] + (call DestroyAAAVeh),3000];
private _IntelShowPos = allUnits select { (typeof _x) in ([(call sAAAVeh)] + [(call sAAAVehMilitia)] + (call DestroyAAAVeh)) && { (_x distance2D (TRGM_VAR_ObjectivePositions select _iTaskIndex)) < 3000 }; };
private _iCount = count _IntelShowPos;
private _iStep = 0;
if (_iCount > 0) then {
Expand Down

0 comments on commit fd21a92

Please sign in to comment.