ACE3/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf
PabstMirror 794a1f9922 Wirecutter handles interact event
adds helper objects to all fences that have actions
2015-03-10 16:01:46 -05:00

29 lines
532 B
Plaintext

/*
* Author: PabstMirror
* Gets nearest fence object (not actully used, left for utility)
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* The return value <OBJECT>
*
* Example:
* [player] call ace_logistics_wirecutter_fnc_getNearestFence
*
* Public: Yes
*/
#include "script_component.hpp"
private "_nearestFence";
PARAMS_1(_unit);
_nearestFence = objNull;
{
if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then {
_nearestFence = _x;
};
} forEach nearestObjects [_unit, [], 15];
_nearestFence