2015-03-10 21:01:46 +00:00
|
|
|
/*
|
|
|
|
* 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;
|
|
|
|
{
|
2015-04-15 23:32:47 +00:00
|
|
|
if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then {
|
|
|
|
_nearestFence = _x;
|
|
|
|
};
|
2015-03-10 21:01:46 +00:00
|
|
|
} forEach nearestObjects [_unit, [], 15];
|
2015-01-28 09:22:39 +00:00
|
|
|
|
|
|
|
_nearestFence
|