From ef773f158b29c729c0cd15bf20848d79b8f68481 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 29 Aug 2024 09:24:59 +0200 Subject: [PATCH] Update fnc_initVehicle.sqf --- addons/csw/functions/fnc_initVehicle.sqf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/csw/functions/fnc_initVehicle.sqf b/addons/csw/functions/fnc_initVehicle.sqf index 80ff071f10..c616d53263 100644 --- a/addons/csw/functions/fnc_initVehicle.sqf +++ b/addons/csw/functions/fnc_initVehicle.sqf @@ -74,8 +74,8 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { private _ammoActionPath = []; private _magazineLocation = getText (_configOf >> QUOTE(ADDON) >> "magazineLocation"); private _condition = { //IGNORE_PRIVATE_WARNING ["_target", "_player"]; - // If magazine handling is enabled or weapon assembly/disassembly is enabled we enable ammo handling - if ((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false }; + // If magazine handling and weapon assembly/disassembly are enabled we enable ammo handling + if ((GVAR(ammoHandling) == 0) || {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false }; [_player, _target, ["isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith) }; private _childrenCode = { @@ -93,7 +93,11 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { _ammoActionPath = [_typeOf, 0, ["ACE_MainActions"], _ammoAction] call EFUNC(interact_menu,addActionToClass); }; - if (["ace_reload"] call EFUNC(common,isModLoaded)) then { + if ( + ["ace_reload"] call EFUNC(common,isModLoaded) && + {GVAR(ammoHandling) isNotEqualTo 0} && + {([false, true, true, GVAR(defaultAssemblyMode)] select (_vehicle getVariable [QGVAR(assemblyMode), 3]))} + ) then { // move reload's check ammo action to the ammo handling point (remove and re-add) [_typeOf, 0, ["ACE_MainActions", QEGVAR(reload,CheckAmmo)]] call EFUNC(interact_menu,removeActionFromClass); private _checkAmmoAction = [QGVAR(checkAmmo), LELSTRING(reload,checkAmmo), "", EFUNC(reload,checkAmmo), EFUNC(reload,canCheckAmmo)] call EFUNC(interact_menu,createAction);