2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-07-03 21:14:23 +00:00
|
|
|
/*
|
|
|
|
* Author: KoffeinFlummi
|
2015-08-16 18:14:54 +00:00
|
|
|
* Checks if a unit is near an engineering vehicle.
|
2015-07-03 21:14:23 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2015-08-16 18:14:54 +00:00
|
|
|
* 0: Unit <OBJECT>
|
2015-07-03 21:14:23 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-16 18:14:54 +00:00
|
|
|
* Is near engineering vehicle <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [unit] call ace_repair_fnc_isNearRepairVehicle
|
2015-07-03 21:14:23 +00:00
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
|
|
|
|
2015-08-09 06:54:44 +00:00
|
|
|
params ["_unit"];
|
|
|
|
TRACE_1("params",_unit);
|
|
|
|
|
2017-07-08 19:01:05 +00:00
|
|
|
private _nearObjects = nearestObjects [_unit, ["Air", "LandVehicle", "Slingload_base_F"], 20];
|
2015-07-03 21:14:23 +00:00
|
|
|
|
2017-07-08 19:01:05 +00:00
|
|
|
private _return = false;
|
2015-07-03 21:14:23 +00:00
|
|
|
{
|
2018-04-13 23:37:08 +00:00
|
|
|
if (alive _x && {[_x] call FUNC(isRepairVehicle)}) exitWith {_return = true;};
|
2015-08-09 06:54:44 +00:00
|
|
|
} forEach _nearObjects;
|
2015-07-03 21:14:23 +00:00
|
|
|
|
|
|
|
_return;
|