diff --git a/addons/cookoff/CfgVehicles.hpp b/addons/cookoff/CfgVehicles.hpp index b08386ac88..7a682ca9d0 100644 --- a/addons/cookoff/CfgVehicles.hpp +++ b/addons/cookoff/CfgVehicles.hpp @@ -53,6 +53,13 @@ class CfgVehicles { explosionEffect = "FuelExplosionBig"; }; + class APC_Wheeled_02_base_F: Wheeled_APC_F { // Otokar ARMA - RCWS Turret + GVAR(ignoreTurret) = 1; + }; + class APC_Tracked_01_base_F: Tank_F { // Namera, Nemmera - RCWS Turret + GVAR(ignoreTurret) = 1; + }; + class B_MBT_01_base_F; class B_MBT_01_cannon_F: B_MBT_01_base_F { GVAR(turret)[] = {QGVAR(Turret_MBT_01),{0,-1,0.5}}; diff --git a/addons/cookoff/functions/fnc_handleDamage.sqf b/addons/cookoff/functions/fnc_handleDamage.sqf index 10a2f69bba..d9fbaf4cef 100644 --- a/addons/cookoff/functions/fnc_handleDamage.sqf +++ b/addons/cookoff/functions/fnc_handleDamage.sqf @@ -81,6 +81,7 @@ if (_simulationType == "tank") exitWith { }; } else { if (_hitpoint in ["hithull", "hitturret", "#structural"] && {_newDamage > 0.8 + random 0.2}) then { + if ((_hitpoint == "hitturret") && {(getNumber (_vehicle call CBA_fnc_getObjectConfig >> QGVAR(ignoreTurret))) == 1}) exitWith {}; // ignore turrets like RCWS _vehicle setDamage 1; }; }; diff --git a/docs/wiki/framework/cookoff-framework.md b/docs/wiki/framework/cookoff-framework.md index d492952df7..2f2734df23 100644 --- a/docs/wiki/framework/cookoff-framework.md +++ b/docs/wiki/framework/cookoff-framework.md @@ -41,3 +41,14 @@ class MyVehicle { Global cook off probability can also be adjusted with the `ace_cookoff_probabilityCoef` mission setting. Higher values will make cook-off more probable, whilst lower values will make cook-off less probable. + +## 3. Ignore damage to turret + +For use on vehicles when damage to the main turret would not cause a vehicle cookoff. +e.g. RCWS turrets + +``` +class MyVehicle { + ace_cookoff_ignoreTurret = 1; +}; +```