ACE3/addons/rearm/functions/fnc_canReadSupplyCounter.sqf
PabstMirror 64a06ddb07
Merge pull request #6674 from acemod/pr/6424
Rearm - Fix for 3den PR
2018-11-11 15:25:39 -06:00

27 lines
645 B
Plaintext

#include "script_component.hpp"
/*
* Author: GitHawk
* Checks if unit can read supply counter. [Only for GVAR(supply) > 0]
*
* Arguments:
* 0: Ammo Truck <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* Can read supply counter <BOOL>
*
* Example:
* [ammo_truck, player] call ace_rearm_fnc_canReadSupplyCounter
*
* Public: No
*/
params ["_truck", "_unit"];
(alive _unit)
&& {alive _truck}
&& {(_truck distance _unit) < REARM_ACTION_DISTANCE}
&& {GVAR(supply) > 0}
&& {[_unit, _truck, ["IsNotInside"]] call EFUNC(common,canInteractWith)} // manually added actions need this
&& {(_truck getVariable [QGVAR(currentSupply), 0]) >= 0}