2015-08-20 17:51:22 +00:00
|
|
|
/*
|
|
|
|
* Author: GitHawk
|
|
|
|
* Check if a unit can store ammo in an ammo truck.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Target <OBJECT>
|
|
|
|
* 1: Unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Can Store Ammo <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
2016-02-27 20:05:19 +00:00
|
|
|
* [ammo_truck, player] call ace_rearm_fnc_canStoreAmmo
|
2015-08-20 17:51:22 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2017-09-29 19:53:25 +00:00
|
|
|
params ["_truck", "_unit"];
|
2017-06-08 16:47:52 +00:00
|
|
|
|
|
|
|
(alive _unit)
|
|
|
|
&& {_unit isKindOf "CAManBase"}
|
|
|
|
&& {local _unit}
|
|
|
|
&& {!isNull (_unit getVariable [QGVAR(dummy), objNull])}
|
|
|
|
&& {alive _truck}
|
|
|
|
&& {(_truck distance _unit) < REARM_ACTION_DISTANCE}
|
|
|
|
&& {[_unit, _truck, ["IsNotInside"]] call EFUNC(common,canInteractWith)} // manually added actions need this
|