ACE3/addons/repair/functions/fnc_isNearRepairVehicle.sqf

29 lines
579 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
* Author: KoffeinFlummi
* Checks if a unit is near an engineering vehicle.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Is near engineering vehicle <BOOL>
*
* Example:
* [unit] call ace_repair_fnc_isNearRepairVehicle
*
* Public: Yes
*/
2015-08-09 06:54:44 +00:00
params ["_unit"];
TRACE_1("params",_unit);
private _nearObjects = nearestObjects [_unit, ["Air", "LandVehicle", "Slingload_base_F"], 20];
private _return = false;
{
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;
_return;