diff --git a/addons/cookoff/ACE_Settings.hpp b/addons/cookoff/ACE_Settings.hpp
index d77a828fad..13ef915ffb 100644
--- a/addons/cookoff/ACE_Settings.hpp
+++ b/addons/cookoff/ACE_Settings.hpp
@@ -12,10 +12,16 @@ class ACE_Settings {
value = 1;
typeName = "BOOL";
};
- class GVAR(enableAmmoCookoff) {
+ class GVAR(enableAmmoCookoff) { // For CBA Setting Switch: we can eliminate and just use (ammoCookoffDuration == 0)
displayName = CSTRING(enableAmmoCookoff_name);
description = CSTRING(enableAmmoCookoff_tooltip);
value = 1;
typeName = "BOOL";
};
+ class GVAR(ammoCookoffDuration) {
+ displayName = CSTRING(ammoCookoffDuration_name);
+ description = CSTRING(ammoCookoffDuration_tooltip);
+ value = 1;
+ typeName = "SCALAR";
+ };
};
diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf
index 96612ed132..b7bed03475 100644
--- a/addons/cookoff/XEH_postInit.sqf
+++ b/addons/cookoff/XEH_postInit.sqf
@@ -81,6 +81,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;
["AllVehicles", "killed", {
params ["_vehicle"];
if (_vehicle getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)]) then {
+ if (GVAR(ammoCookoffDuration) == 0) exitWith {};
([_vehicle] call FUNC(getVehicleAmmo)) params ["_mags", "_total"];
[_vehicle, _mags, _total] call FUNC(detonateAmmunition);
};
diff --git a/addons/cookoff/functions/fnc_cookOffBox.sqf b/addons/cookoff/functions/fnc_cookOffBox.sqf
index 8d4d421e36..f944d917e8 100644
--- a/addons/cookoff/functions/fnc_cookOffBox.sqf
+++ b/addons/cookoff/functions/fnc_cookOffBox.sqf
@@ -45,6 +45,7 @@ if (local _box) then {
// These functions are smart and do all the cooking off work
if (local _box) then {
if (_box getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)]) then {
+ if (GVAR(ammoCookoffDuration) == 0) exitWith {};
([_box] call FUNC(getVehicleAmmo)) params ["_mags", "_total"];
[_box, _mags, _total] call FUNC(detonateAmmunition);
};
diff --git a/addons/cookoff/functions/fnc_detonateAmmunition.sqf b/addons/cookoff/functions/fnc_detonateAmmunition.sqf
index 21c72518f1..20ec84cbbd 100644
--- a/addons/cookoff/functions/fnc_detonateAmmunition.sqf
+++ b/addons/cookoff/functions/fnc_detonateAmmunition.sqf
@@ -31,7 +31,7 @@ private _magazine = _magazines select _magazineIndex;
_magazine params ["_magazineClassname", "_amountOfMagazines"];
if (_amountOfMagazines > 0) exitWith {
- private _removed = _amountOfMagazines min floor(1 + random(6));
+ private _removed = _amountOfMagazines min floor(1 + random(6 / GVAR(ammoCookoffDuration)));
_amountOfMagazines = _amountOfMagazines - _removed;
if (_amountOfMagazines <= 0) then {
diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml
index a0d20d6f5e..9bd2ae1f34 100644
--- a/addons/cookoff/stringtable.xml
+++ b/addons/cookoff/stringtable.xml
@@ -60,5 +60,11 @@
Ermöglicht Selbstzündung von Munition. Feuert Projektile der Munition ab, solange das Fahrzeug brennt und Munition besitzt.
Aktywuje samozapłon amunicji. Wystrzeliwuje pociski podczas gdy pojazd płonie i posiada amunicję.
+
+ Ammunition cook off duration
+
+
+ Multiplier for how long cook off lasts [Setting to 0 will disable ammo cookoff]
+
-
\ No newline at end of file
+