2023-09-12 18:58:10 +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
|
|
|
|
*/
|
|
|
|
|
2023-07-06 03:52:04 +00:00
|
|
|
#define CHECK_OBJECTS(var) ((var) findIf {alive _x && {[_x] call FUNC(isRepairVehicle)}} != -1)
|
|
|
|
|
2015-08-09 06:54:44 +00:00
|
|
|
params ["_unit"];
|
|
|
|
TRACE_1("params",_unit);
|
|
|
|
|
2023-07-06 03:52:04 +00:00
|
|
|
private _fnc_check = {
|
|
|
|
private _nearObjects = nearestObjects [_unit, ["Air", "LandVehicle", "Slingload_base_F"], 20];
|
|
|
|
CHECK_OBJECTS(_nearObjects)
|
|
|
|
};
|
2015-07-03 21:14:23 +00:00
|
|
|
|
2023-07-06 03:52:04 +00:00
|
|
|
[[], _fnc_check, _unit, QGVAR(nearRepairVehicleCache), NEAR_REPAIR_VEHICLE_CACHE_EXPIRY] call EFUNC(common,cachedCall);
|