2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2017-10-11 19:05:54 +00:00
|
|
|
/*
|
|
|
|
* Author: 654wak654
|
|
|
|
* Checks if given unit can access the pylon configuration dialog for the given aircraft.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Aircraft <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Unit can configure the aircraft's pylons <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [ace_player, cursorObject] call ace_pylons_fnc_canConfigurePylons
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_unit", "_aircraft"];
|
|
|
|
|
2017-10-25 01:49:51 +00:00
|
|
|
if (GVAR(requireEngineer) && {!([_unit] call EFUNC(common,isEngineer))}) exitWith {false};
|
2017-10-11 19:05:54 +00:00
|
|
|
|
|
|
|
if (GVAR(requireToolkit) && {!([_unit, "ToolKit"] call EFUNC(common,hasItem))}) exitWith {false};
|
|
|
|
|
2017-10-26 04:13:44 +00:00
|
|
|
if ((_unit distanceSqr _aircraft) > GVAR(searchDistanceSqr)) exitWith {false};
|
|
|
|
|
|
|
|
[_unit, _aircraft] call EFUNC(common,canInteractWith)
|