ACE3/addons/refuel/functions/fnc_canRefuel.sqf

25 lines
527 B
Plaintext
Raw Normal View History

2015-08-13 17:33:55 +00:00
/*
* Author: GitHawk
* Check if a unit can refuel
*
* Arguments:
* 0: The target <OBJECT>
*
* Return Value:
2015-08-14 01:18:54 +00:00
* Can refuel <BOOL>
2015-08-13 17:33:55 +00:00
*
* Example:
* [unit, target] call ace_refuel_fnc_canRefuel
*
2015-08-14 01:18:54 +00:00
* Public: No
2015-08-13 17:33:55 +00:00
*/
#include "script_component.hpp"
private ["_fuel"];
params ["_unit", "_target"];
if (isNull _unit || {!(_unit isKindOf "CAManBase")} || {!local _unit} || { (_target distance _unit) > 7}) exitWith {false};
_fuel = [_unit, _target] call FUNC(getFuel);
if (_fuel > 0 || {_fuel == -1}) exitWith {true};
false