mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
763df43fbc
> vehicle setVariable ["ace_rearm_disabled", true, true]; Also added ammo compatibility for RHS Mi24 with turret
30 lines
819 B
Plaintext
30 lines
819 B
Plaintext
/*
|
|
* Author: GitHawk, Jonpas
|
|
* Check if a unit can rearm.
|
|
*
|
|
* Arguments:
|
|
* 0: Target <OBJECT>
|
|
* 1: Unit <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* Can Rearm <BOOL>
|
|
*
|
|
* Example:
|
|
* [player, tank] call ace_rearm_fnc_canRearm
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
private ["_dummy","_magazineClass"];
|
|
params ["_target", "_unit"];
|
|
|
|
if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {_target distance _unit > REARM_ACTION_DISTANCE} || {_target getVariable [QGVAR(disabled), false]}) exitWith {false};
|
|
|
|
_dummy = _unit getVariable [QGVAR(dummy), objNull];
|
|
if (isNull _dummy) exitwith {false};
|
|
_magazineClass = _dummy getVariable QGVAR(magazineClass);
|
|
if (isNil "_magazineClass") exitWith {false};
|
|
|
|
([_target, _magazineClass] call FUNC(getNeedRearmMagazines)) select 0
|