ACE3/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf

29 lines
540 B
Plaintext
Raw Normal View History

/*
* 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
*/
2015-01-28 09:22:39 +00:00
#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];
2015-01-28 09:22:39 +00:00
_nearestFence