2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2017-02-10 18:47:08 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Reports near units.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
2017-05-31 16:31:10 +00:00
|
|
|
* Near Units <ARRAY>
|
2017-02-10 18:47:08 +00:00
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* call ACE_laserpointer_fnc_getNearUnits
|
|
|
|
*
|
2017-02-10 18:47:08 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
private _camPosAGL = positionCameraToWorld [0, 0, 0];
|
|
|
|
|
|
|
|
// handle RHS / bugged vehicle slots
|
2017-05-31 16:31:10 +00:00
|
|
|
if !((_camPosAGL select 0) isEqualType 0) exitWith { [] };
|
2017-02-10 18:47:08 +00:00
|
|
|
|
|
|
|
private _nearUnits = [];
|
|
|
|
|
|
|
|
{
|
|
|
|
_nearUnits append crew _x;
|
|
|
|
} forEach nearestObjects [_camPosAGL, ["AllVehicles"], MAX_LASER_RANGE];
|
|
|
|
|
|
|
|
_nearUnits
|