2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-08-15 16:43:13 +00:00
|
|
|
/*
|
|
|
|
* Author: GitHawk
|
2015-08-18 00:32:10 +00:00
|
|
|
* Check if a unit can pick up ammo.
|
2015-08-15 16:43:13 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2015-08-18 01:37:02 +00:00
|
|
|
* 0: Target <OBJECT>
|
|
|
|
* 1: Unit <OBJECT>
|
2015-08-15 16:43:13 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-18 00:32:10 +00:00
|
|
|
* Can Pick Up Ammo <BOOL>
|
2015-08-15 16:43:13 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2016-02-27 20:05:19 +00:00
|
|
|
* [ammo_truck, player] call ace_rearm_fnc_canTakeAmmo
|
2015-08-15 16:43:13 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2017-09-29 19:53:25 +00:00
|
|
|
params ["_truck", "_unit"];
|
2015-08-15 16:43:13 +00:00
|
|
|
|
2017-06-08 16:47:52 +00:00
|
|
|
(alive _unit)
|
|
|
|
&& {alive _truck}
|
|
|
|
&& {(_truck distance _unit) < REARM_ACTION_DISTANCE}
|
|
|
|
&& {isNull (_unit getVariable [QGVAR(dummy), objNull])}
|
|
|
|
&& {[_unit, _truck, ["IsNotInside"]] call EFUNC(common,canInteractWith)} // manually added actions need this
|
2018-11-02 21:56:16 +00:00
|
|
|
&& {(_truck getVariable [QGVAR(currentSupply), 0]) >= 0}
|