From 763df43fbcc3e670fe6a76a98d52e8c91f4a0018 Mon Sep 17 00:00:00 2001 From: IngoKauffmann Date: Mon, 23 Nov 2015 17:08:06 +0100 Subject: [PATCH] Added possibility to disallow rearm > vehicle setVariable ["ace_rearm_disabled", true, true]; Also added ammo compatibility for RHS Mi24 with turret --- addons/rearm/functions/fnc_addRearmActions.sqf | 2 +- addons/rearm/functions/fnc_canRearm.sqf | 2 +- optionals/compat_rhs_afrf3/CfgAmmo.hpp | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/rearm/functions/fnc_addRearmActions.sqf b/addons/rearm/functions/fnc_addRearmActions.sqf index 038aec18a3..2011cc73de 100644 --- a/addons/rearm/functions/fnc_addRearmActions.sqf +++ b/addons/rearm/functions/fnc_addRearmActions.sqf @@ -68,7 +68,7 @@ _vehicleActions = []; } forEach _magazines; } forEach REARM_TURRET_PATHS; }; - if (_needToAdd) then { + if (_needToAdd && !(_vehicle getVariable [QGVAR(disabled), false])) then { _icon = getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "Icon"); if !((_icon select [0, 1]) == "\") then { _icon = ""; diff --git a/addons/rearm/functions/fnc_canRearm.sqf b/addons/rearm/functions/fnc_canRearm.sqf index 3e070e0f8b..834e6a9202 100644 --- a/addons/rearm/functions/fnc_canRearm.sqf +++ b/addons/rearm/functions/fnc_canRearm.sqf @@ -19,7 +19,7 @@ private ["_dummy","_magazineClass"]; params ["_target", "_unit"]; -if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {_target distance _unit > REARM_ACTION_DISTANCE}) exitWith {false}; +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}; diff --git a/optionals/compat_rhs_afrf3/CfgAmmo.hpp b/optionals/compat_rhs_afrf3/CfgAmmo.hpp index 541437458e..4e236439e8 100644 --- a/optionals/compat_rhs_afrf3/CfgAmmo.hpp +++ b/optionals/compat_rhs_afrf3/CfgAmmo.hpp @@ -122,4 +122,8 @@ class CfgAmmo ACE_muzzleVelocities[]={298, 330, 350}; ACE_barrelLengths[]={96.52, 127.0, 228.6}; }; -}; \ No newline at end of file + class SubmunitionBase; + class rhs_ammo_127x108mm_x5: SubmunitionBase { + ACE_rearm_caliber=13; + } +};