diff --git a/addons/mk6mortar/ACE_Settings.hpp b/addons/mk6mortar/ACE_Settings.hpp index be7625bc3a..6d1eebf942 100644 --- a/addons/mk6mortar/ACE_Settings.hpp +++ b/addons/mk6mortar/ACE_Settings.hpp @@ -15,4 +15,9 @@ class ACE_Settings { typeName = "BOOL"; isClientSetable = 0; }; + class GVAR(useAmmoHandling) { + value = 0; + typeName = "BOOL"; + isClientSetable = 0; + }; }; diff --git a/addons/mk6mortar/CfgVehicles.hpp b/addons/mk6mortar/CfgVehicles.hpp index f344f0c7f2..b70ddc7ae2 100644 --- a/addons/mk6mortar/CfgVehicles.hpp +++ b/addons/mk6mortar/CfgVehicles.hpp @@ -20,15 +20,12 @@ class CfgVehicles { class Turrets { class MainTurret; }; - class ACE_Actions; }; class StaticMortar: StaticWeapon { class Turrets: Turrets { class MainTurret: MainTurret {}; }; - class ACE_Actions: ACE_Actions { - class ACE_MainActions; - }; + class ACE_Actions; }; class Mortar_01_base_F: StaticMortar { class Turrets: Turrets { @@ -41,7 +38,7 @@ class CfgVehicles { class ACE_Actions: ACE_Actions { class GVAR(unloadMagazine) { displayName = CSTRING(unloadMortar); - distance = 4; + distance = 2; condition = QUOTE(_this call FUNC(canUnloadMagazine)); statement = QUOTE([ARR_3(_target,_player,5)] call FUNC(unloadMagazineTimer)); icon = ""; @@ -49,42 +46,42 @@ class CfgVehicles { }; class GVAR(LoadActions) { displayName = CSTRING(loadMortar); - distance = 4; + distance = 2; condition = QUOTE([ARR_2(_target,_player)] call FUNC(canLoadMagazine)); statement = ""; icon = ""; selection = "usti hlavne"; class GVAR(loadMagazine_HE_Guided) { displayName = CSTRING(loadMagazine_HE_Guided); - distance = 4; + distance = 2; condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(canLoadMagazine)); statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(loadMagazineTimer)); icon = ""; }; class GVAR(loadMagazine_HE_LaserGuided) { displayName = CSTRING(loadMagazine_HE_LaserGuided); - distance = 4; + distance = 2; condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(canLoadMagazine)); statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(loadMagazineTimer)); icon = ""; }; class GVAR(loadMagazine_Illum) { displayName = CSTRING(loadMagazine_Illum); - distance = 4; + distance = 2; condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_Illum')] call FUNC(canLoadMagazine)); statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_Illum')] call FUNC(loadMagazineTimer)); icon = ""; }; class GVAR(loadMagazine_Smoke) { displayName = CSTRING(loadMagazine_Smoke); - distance = 4; + distance = 2; condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(canLoadMagazine)); statement = QUOTE([ARR_4(_target,_player,3,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(loadMagazineTimer)); icon = ""; }; class GVAR(loadMagazine_HE) { displayName = CSTRING(loadMagazine_HE); - distance = 4; + distance = 2; condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(canLoadMagazine)); statement = QUOTE([ARR_4(_target,_player,3,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(loadMagazineTimer)); icon = ""; @@ -131,6 +128,12 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class useAmmoHandling { + displayName = CSTRING(useAmmoHandling_DisplayName); + description = CSTRING(useAmmoHandling_Description); + typeName = "BOOL"; + defaultValue = 0; + }; }; class ModuleDescription { description = CSTRING(Module_Description); diff --git a/addons/mk6mortar/functions/fnc_canLoadMagazine.sqf b/addons/mk6mortar/functions/fnc_canLoadMagazine.sqf index 4ba6db3720..6670228faf 100644 --- a/addons/mk6mortar/functions/fnc_canLoadMagazine.sqf +++ b/addons/mk6mortar/functions/fnc_canLoadMagazine.sqf @@ -22,7 +22,7 @@ params ["_static","_unit",["_magazineClassOptional","",[""]]]; private ["_canLoadMagazine","_currentMagazine","_weapon","_listOfMagNames", "_hasCompatibleMagazine","_count"]; -if !(alive _static) exitWith {false}; +if !(alive _static && {GVAR(useAmmoHandling)}) exitWith {false}; _canLoadMagazine = false; diff --git a/addons/mk6mortar/functions/fnc_canUnloadMagazine.sqf b/addons/mk6mortar/functions/fnc_canUnloadMagazine.sqf index 99634988a0..e4a609b34d 100644 --- a/addons/mk6mortar/functions/fnc_canUnloadMagazine.sqf +++ b/addons/mk6mortar/functions/fnc_canUnloadMagazine.sqf @@ -19,7 +19,7 @@ params ["_static","_unit"]; private ["_canUnloadMagazine","_ammoCount"]; -if !(alive _static) exitWith {false}; +if !(alive _static && {GVAR(useAmmoHandling)}) exitWith {false}; _canUnloadMagazine = false; _ammoCount = ((magazinesAllTurrets _static) select 1) select 2; diff --git a/addons/mk6mortar/functions/fnc_loadMagazine.sqf b/addons/mk6mortar/functions/fnc_loadMagazine.sqf index 735244edc3..80737c7574 100644 --- a/addons/mk6mortar/functions/fnc_loadMagazine.sqf +++ b/addons/mk6mortar/functions/fnc_loadMagazine.sqf @@ -19,7 +19,7 @@ params ["_static","_unit",["_magazineClassOptional","",[""]]]; private ["_weapon","_currentMagazine","_count","_magazines","_magazineDetails","_listOfMagNames", - "_magazineClass","_magazineClassDetails","_parsed","_roundsLeft","_configMortar"]; + "_magazineClass","_magazineClassDetails","_parsed","_roundsLeft"]; //Get weapon & magazine information of static weapon _weapon = (_static weaponsTurret [0]) select 0; @@ -54,7 +54,6 @@ if (_magazineClassDetails != "") then{ _magType = _type; }; -//_configMortar = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> QGVAR(isMortarRound)); //If function has been called with an optional classname hten add that magazine to the static weapon. Otherwise add the compatible magazine if(_magazineClassOptional !="") then{ _unit removeMagazine _magazineClassOptional; diff --git a/addons/mk6mortar/functions/fnc_moduleInit.sqf b/addons/mk6mortar/functions/fnc_moduleInit.sqf index 75bab4cee9..3dedbb2c9e 100644 --- a/addons/mk6mortar/functions/fnc_moduleInit.sqf +++ b/addons/mk6mortar/functions/fnc_moduleInit.sqf @@ -25,3 +25,4 @@ if (!isServer) exitWith {}; [_logic, QGVAR(airResistanceEnabled), "airResistanceEnabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowComputerRangefinder), "allowComputerRangefinder"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowCompass), "allowCompass"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(useAmmoHandling), "useAmmoHandling"] call EFUNC(common,readSettingFromModule); diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index 4c949b701a..3a2fa63dcf 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -192,5 +192,11 @@ Used in Mk6 mortar + + Ammunition handling + + + Removes mortar magazines, requiring individual rounds to be loaded by the gunner or loader +