From b60e55522e917c0a982cc8cb86121a582049ef4a Mon Sep 17 00:00:00 2001 From: Cyruz143 Date: Sat, 24 Aug 2019 00:36:31 +0100 Subject: [PATCH 01/11] Add setting for cookoff to only run for player crewed vehicles --- addons/cookoff/CfgEden.hpp | 10 ++++++++++ addons/cookoff/functions/fnc_handleDamage.sqf | 4 ++++ addons/cookoff/initSettings.sqf | 10 ++++++++++ addons/cookoff/stringtable.xml | 6 ++++++ 4 files changed, 30 insertions(+) diff --git a/addons/cookoff/CfgEden.hpp b/addons/cookoff/CfgEden.hpp index caffc6b90ba..5492bbd9f0e 100644 --- a/addons/cookoff/CfgEden.hpp +++ b/addons/cookoff/CfgEden.hpp @@ -14,6 +14,16 @@ class Cfg3DEN { condition = "objectVehicle"; defaultValue = QUOTE(GETMVAR(QGVAR(enable),true)); }; + class GVAR(disableForAI) { + property = QGVAR(disableForAI); + control = "Checkbox"; + displayName = CSTRING(disableForAI_name); + tooltip = CSTRING(disableForAI_tooltip); + expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};); + typeName = "BOOL"; + condition = "objectVehicle"; + defaultValue = QUOTE(GETMVAR(QGVAR(disableForAI),false)); + }; class GVAR(enableAmmoCookoff) { property = QGVAR(enableAmmoCookoff); control = "Checkbox"; diff --git a/addons/cookoff/functions/fnc_handleDamage.sqf b/addons/cookoff/functions/fnc_handleDamage.sqf index e9765805cbe..d837630fb39 100644 --- a/addons/cookoff/functions/fnc_handleDamage.sqf +++ b/addons/cookoff/functions/fnc_handleDamage.sqf @@ -21,6 +21,10 @@ _thisHandleDamage params ["_vehicle", "", "_damage", "_source", "_ammo", "_hitIn // it's already dead, who cares? if (damage _vehicle >= 1) exitWith {}; +// Check for players and exit if none found and the disable for AI setting is true +private _playerCrew = (fullCrew [_vehicle, "", false]) findIf {isPlayer (_x #0)}; +if (_vehicle getVariable [QGVAR(disableForAI), GVAR(disableForAI)] && _playerCrew isEqualTo -1) exitWith {}; + // get hitpoint name private _hitpoint = "#structural"; diff --git a/addons/cookoff/initSettings.sqf b/addons/cookoff/initSettings.sqf index b29d2134274..f928f5aeaee 100644 --- a/addons/cookoff/initSettings.sqf +++ b/addons/cookoff/initSettings.sqf @@ -10,6 +10,16 @@ true // Needs mission restart ] call CBA_settings_fnc_init; +[ + QGVAR(disableForAI), "CHECKBOX", + [LSTRING(disableForAI_name), LSTRING(disableForAI_tooltip)], + LSTRING(category_displayName), + false, // default value + true, // isGlobal + {[QGVAR(disableForAI), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart +] call CBA_settings_fnc_init; + [ QGVAR(enableAmmobox), "CHECKBOX", [LSTRING(enableBoxCookoff_name), LSTRING(enableBoxCookoff_tooltip)], diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index 452b213fe9b..5da0456e6af 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -25,6 +25,12 @@ 誘爆の損傷処理と砲塔の爆発効果を変更します。 Изменяет обработку урона для возгорания и эффекта срыва башни + + Disable cook off for AI vehicles + + + Cook off will only run on player crewed vehicles + Wreck (Turret) Épave (tourelle) From d9088fc9d5b1700f71714db1dd34ec1403a381e3 Mon Sep 17 00:00:00 2001 From: Cyruz143 Date: Sat, 24 Aug 2019 00:54:34 +0100 Subject: [PATCH 02/11] No point having per vehicle selection --- addons/cookoff/CfgEden.hpp | 10 ---------- addons/cookoff/XEH_postInit.sqf | 3 +++ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/addons/cookoff/CfgEden.hpp b/addons/cookoff/CfgEden.hpp index 5492bbd9f0e..caffc6b90ba 100644 --- a/addons/cookoff/CfgEden.hpp +++ b/addons/cookoff/CfgEden.hpp @@ -14,16 +14,6 @@ class Cfg3DEN { condition = "objectVehicle"; defaultValue = QUOTE(GETMVAR(QGVAR(enable),true)); }; - class GVAR(disableForAI) { - property = QGVAR(disableForAI); - control = "Checkbox"; - displayName = CSTRING(disableForAI_name); - tooltip = CSTRING(disableForAI_tooltip); - expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};); - typeName = "BOOL"; - condition = "objectVehicle"; - defaultValue = QUOTE(GETMVAR(QGVAR(disableForAI),false)); - }; class GVAR(enableAmmoCookoff) { property = QGVAR(enableAmmoCookoff); control = "Checkbox"; diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf index fad901982d9..2d3ec147821 100644 --- a/addons/cookoff/XEH_postInit.sqf +++ b/addons/cookoff/XEH_postInit.sqf @@ -26,6 +26,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; GVAR(cacheTankDuplicates) setVariable [_typeOf, _duplicateHitpoints]; }; + _vehicle setVariable [QGVAR(disableForAI), GVAR(disableForAI), true]; _vehicle addEventHandler ["HandleDamage", { if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)]) then { ["tank", _this] call FUNC(handleDamage); @@ -52,6 +53,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; GVAR(cacheTankDuplicates) setVariable [_typeOf, _duplicateHitpoints]; }; + _vehicle setVariable [QGVAR(disableForAI), GVAR(disableForAI), true]; _vehicle addEventHandler ["HandleDamage", { if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)]) then { ["tank", _this] call FUNC(handleDamage); @@ -62,6 +64,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; ["Car", "init", { params ["_vehicle"]; + _vehicle setVariable [QGVAR(disableForAI), GVAR(disableForAI), true]; _vehicle addEventHandler ["HandleDamage", { if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)]) then { ["car", _this] call FUNC(handleDamage); From 417c109cc39ddede6824a31c8d41ff76cfd451a1 Mon Sep 17 00:00:00 2001 From: Cyruz143 Date: Sat, 24 Aug 2019 12:36:51 +0100 Subject: [PATCH 03/11] Merging mutliple settings in to one --- addons/cookoff/XEH_postInit.sqf | 11 ++++------- addons/cookoff/functions/fnc_handleDamage.sqf | 4 ++-- addons/cookoff/initSettings.sqf | 14 ++------------ addons/cookoff/stringtable.xml | 7 ++----- 4 files changed, 10 insertions(+), 26 deletions(-) diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf index 2d3ec147821..c8ef6f14841 100644 --- a/addons/cookoff/XEH_postInit.sqf +++ b/addons/cookoff/XEH_postInit.sqf @@ -26,9 +26,8 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; GVAR(cacheTankDuplicates) setVariable [_typeOf, _duplicateHitpoints]; }; - _vehicle setVariable [QGVAR(disableForAI), GVAR(disableForAI), true]; _vehicle addEventHandler ["HandleDamage", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)]) then { + if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] !=0 ) then { ["tank", _this] call FUNC(handleDamage); }; }]; @@ -53,9 +52,8 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; GVAR(cacheTankDuplicates) setVariable [_typeOf, _duplicateHitpoints]; }; - _vehicle setVariable [QGVAR(disableForAI), GVAR(disableForAI), true]; _vehicle addEventHandler ["HandleDamage", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)]) then { + if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] !=0 ) then { ["tank", _this] call FUNC(handleDamage); }; }]; @@ -64,9 +62,8 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; ["Car", "init", { params ["_vehicle"]; - _vehicle setVariable [QGVAR(disableForAI), GVAR(disableForAI), true]; _vehicle addEventHandler ["HandleDamage", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)]) then { + if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] !=0 ) then { ["car", _this] call FUNC(handleDamage); }; }]; @@ -92,7 +89,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; // blow off turret effect ["Tank", "killed", { - if ((_this select 0) getVariable [QGVAR(enable),GVAR(enable)]) then { + if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] !=0 ) then { if (random 1 < 0.15) then { (_this select 0) call FUNC(blowOffTurret); }; diff --git a/addons/cookoff/functions/fnc_handleDamage.sqf b/addons/cookoff/functions/fnc_handleDamage.sqf index d837630fb39..cca2bfbb1ec 100644 --- a/addons/cookoff/functions/fnc_handleDamage.sqf +++ b/addons/cookoff/functions/fnc_handleDamage.sqf @@ -22,8 +22,8 @@ _thisHandleDamage params ["_vehicle", "", "_damage", "_source", "_ammo", "_hitIn if (damage _vehicle >= 1) exitWith {}; // Check for players and exit if none found and the disable for AI setting is true -private _playerCrew = (fullCrew [_vehicle, "", false]) findIf {isPlayer (_x #0)}; -if (_vehicle getVariable [QGVAR(disableForAI), GVAR(disableForAI)] && _playerCrew isEqualTo -1) exitWith {}; +private _hasPlayerInCrew = fullCrew [_vehicle, "", false] findIf {isPlayer (_x select 0)} != -1; +if (_vehicle getVariable [QGVAR(enable), GVAR(enable)] isEqualTo 2 && !_hasPlayerInCrew) exitWith {}; // get hitpoint name private _hitpoint = "#structural"; diff --git a/addons/cookoff/initSettings.sqf b/addons/cookoff/initSettings.sqf index f928f5aeaee..023cdfae46a 100644 --- a/addons/cookoff/initSettings.sqf +++ b/addons/cookoff/initSettings.sqf @@ -1,25 +1,15 @@ // CBA Settings [ADDON: ace_cookoff]: [ - QGVAR(enable), "CHECKBOX", + QGVAR(enable), "LIST", [LSTRING(enable_hd_name), LSTRING(enable_hd_tooltip)], LSTRING(category_displayName), - false, // default value + [[0, 1, 2], ["STR_A3_OPTIONS_DISABLED", "STR_A3_OPTIONS_ENABLED", LSTRING(enableForPlayers_name)], 0] true, // isGlobal {[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart ] call CBA_settings_fnc_init; -[ - QGVAR(disableForAI), "CHECKBOX", - [LSTRING(disableForAI_name), LSTRING(disableForAI_tooltip)], - LSTRING(category_displayName), - false, // default value - true, // isGlobal - {[QGVAR(disableForAI), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart -] call CBA_settings_fnc_init; - [ QGVAR(enableAmmobox), "CHECKBOX", [LSTRING(enableBoxCookoff_name), LSTRING(enableBoxCookoff_tooltip)], diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index 5da0456e6af..2488f771b95 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -25,11 +25,8 @@ 誘爆の損傷処理と砲塔の爆発効果を変更します。 Изменяет обработку урона для возгорания и эффекта срыва башни - - Disable cook off for AI vehicles - - - Cook off will only run on player crewed vehicles + + Enable for player crewed vehicles Wreck (Turret) From 3523f8e6d25c92d0da66e35421517b1cc05c1759 Mon Sep 17 00:00:00 2001 From: Cyruz143 Date: Sat, 24 Aug 2019 13:08:35 +0100 Subject: [PATCH 04/11] Fixing missing comma --- addons/cookoff/initSettings.sqf | 2 +- addons/cookoff/stringtable.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/cookoff/initSettings.sqf b/addons/cookoff/initSettings.sqf index 023cdfae46a..af928af6bb5 100644 --- a/addons/cookoff/initSettings.sqf +++ b/addons/cookoff/initSettings.sqf @@ -4,7 +4,7 @@ QGVAR(enable), "LIST", [LSTRING(enable_hd_name), LSTRING(enable_hd_tooltip)], LSTRING(category_displayName), - [[0, 1, 2], ["STR_A3_OPTIONS_DISABLED", "STR_A3_OPTIONS_ENABLED", LSTRING(enableForPlayers_name)], 0] + [[0, 1, 2], ["STR_A3_OPTIONS_DISABLED", "STR_A3_OPTIONS_ENABLED", "STR_ACE_CookOff_enableForPlayers"], 0], true, // isGlobal {[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index 2488f771b95..4ed75ab0896 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -25,7 +25,7 @@ 誘爆の損傷処理と砲塔の爆発効果を変更します。 Изменяет обработку урона для возгорания и эффекта срыва башни - + Enable for player crewed vehicles From 79b8a2933a127952b5d3c6f587e476317bbc77fd Mon Sep 17 00:00:00 2001 From: Cyruz143 Date: Sat, 24 Aug 2019 17:20:46 +0100 Subject: [PATCH 05/11] Using LSTRING for settings --- addons/cookoff/initSettings.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cookoff/initSettings.sqf b/addons/cookoff/initSettings.sqf index af928af6bb5..4c9745a1714 100644 --- a/addons/cookoff/initSettings.sqf +++ b/addons/cookoff/initSettings.sqf @@ -4,7 +4,7 @@ QGVAR(enable), "LIST", [LSTRING(enable_hd_name), LSTRING(enable_hd_tooltip)], LSTRING(category_displayName), - [[0, 1, 2], ["STR_A3_OPTIONS_DISABLED", "STR_A3_OPTIONS_ENABLED", "STR_ACE_CookOff_enableForPlayers"], 0], + [[0, 1, 2], ["STR_A3_OPTIONS_DISABLED", "STR_A3_OPTIONS_ENABLED", LSTRING(enableForPlayers)], 0], true, // isGlobal {[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart From 3d2956ed5a21a4888e307cb76b4b838f089f0d8b Mon Sep 17 00:00:00 2001 From: Cyruz143 Date: Sat, 24 Aug 2019 17:35:33 +0100 Subject: [PATCH 06/11] merging suggested fixes --- addons/cookoff/XEH_postInit.sqf | 8 ++++---- addons/cookoff/functions/fnc_handleDamage.sqf | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf index c8ef6f14841..8c75f9ec454 100644 --- a/addons/cookoff/XEH_postInit.sqf +++ b/addons/cookoff/XEH_postInit.sqf @@ -27,7 +27,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; }; _vehicle addEventHandler ["HandleDamage", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] !=0 ) then { + if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] in [1, 2, true]) then { ["tank", _this] call FUNC(handleDamage); }; }]; @@ -53,7 +53,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; }; _vehicle addEventHandler ["HandleDamage", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] !=0 ) then { + if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] in [1, 2, true]) then { ["tank", _this] call FUNC(handleDamage); }; }]; @@ -63,7 +63,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; params ["_vehicle"]; _vehicle addEventHandler ["HandleDamage", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] !=0 ) then { + if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] in [1, 2, true]) then { ["car", _this] call FUNC(handleDamage); }; }]; @@ -89,7 +89,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; // blow off turret effect ["Tank", "killed", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] !=0 ) then { + if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] in [1, 2, true]) then { if (random 1 < 0.15) then { (_this select 0) call FUNC(blowOffTurret); }; diff --git a/addons/cookoff/functions/fnc_handleDamage.sqf b/addons/cookoff/functions/fnc_handleDamage.sqf index cca2bfbb1ec..816dc3d6011 100644 --- a/addons/cookoff/functions/fnc_handleDamage.sqf +++ b/addons/cookoff/functions/fnc_handleDamage.sqf @@ -21,9 +21,8 @@ _thisHandleDamage params ["_vehicle", "", "_damage", "_source", "_ammo", "_hitIn // it's already dead, who cares? if (damage _vehicle >= 1) exitWith {}; -// Check for players and exit if none found and the disable for AI setting is true -private _hasPlayerInCrew = fullCrew [_vehicle, "", false] findIf {isPlayer (_x select 0)} != -1; -if (_vehicle getVariable [QGVAR(enable), GVAR(enable)] isEqualTo 2 && !_hasPlayerInCrew) exitWith {}; +// Check for players and exit if none found and the enable for players only setting is true +if (_vehicle getVariable [QGVAR(enable), GVAR(enable)] isEqualTo 2 && {fullCrew [_vehicle, "", false] findIf {isPlayer (_x select 0)} == -1}) exitWith {}; // get hitpoint name private _hitpoint = "#structural"; From 9e256aac5388264ce134c13033c94e299971e218 Mon Sep 17 00:00:00 2001 From: Cyruz143 Date: Sun, 25 Aug 2019 02:08:01 +0100 Subject: [PATCH 07/11] Moving enabled check to fnc --- addons/cookoff/XEH_postInit.sqf | 14 ++++---------- addons/cookoff/functions/fnc_handleDamage.sqf | 3 +++ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf index 8c75f9ec454..0202c438e14 100644 --- a/addons/cookoff/XEH_postInit.sqf +++ b/addons/cookoff/XEH_postInit.sqf @@ -27,9 +27,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; }; _vehicle addEventHandler ["HandleDamage", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] in [1, 2, true]) then { - ["tank", _this] call FUNC(handleDamage); - }; + ["tank", _this] call FUNC(handleDamage); }]; }, nil, nil, true] call CBA_fnc_addClassEventHandler; @@ -53,9 +51,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; }; _vehicle addEventHandler ["HandleDamage", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] in [1, 2, true]) then { - ["tank", _this] call FUNC(handleDamage); - }; + ["tank", _this] call FUNC(handleDamage); }]; }, nil, nil, true] call CBA_fnc_addClassEventHandler; @@ -63,9 +59,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; params ["_vehicle"]; _vehicle addEventHandler ["HandleDamage", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] in [1, 2, true]) then { - ["car", _this] call FUNC(handleDamage); - }; + ["car", _this] call FUNC(handleDamage); }]; }, nil, ["Wheeled_APC_F"], true] call CBA_fnc_addClassEventHandler; @@ -89,7 +83,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; // blow off turret effect ["Tank", "killed", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] in [1, 2, true]) then { + if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] !=0) then { if (random 1 < 0.15) then { (_this select 0) call FUNC(blowOffTurret); }; diff --git a/addons/cookoff/functions/fnc_handleDamage.sqf b/addons/cookoff/functions/fnc_handleDamage.sqf index 816dc3d6011..60dffa452b0 100644 --- a/addons/cookoff/functions/fnc_handleDamage.sqf +++ b/addons/cookoff/functions/fnc_handleDamage.sqf @@ -21,6 +21,9 @@ _thisHandleDamage params ["_vehicle", "", "_damage", "_source", "_ammo", "_hitIn // it's already dead, who cares? if (damage _vehicle >= 1) exitWith {}; +// If cookoff is disabled exit +if (_vehicle getVariable [QGVAR(enable), GVAR(enable)] in [0, false]) exitWith {}; + // Check for players and exit if none found and the enable for players only setting is true if (_vehicle getVariable [QGVAR(enable), GVAR(enable)] isEqualTo 2 && {fullCrew [_vehicle, "", false] findIf {isPlayer (_x select 0)} == -1}) exitWith {}; From e5fda50e307894aa7c7b17508cf08682fc44b689 Mon Sep 17 00:00:00 2001 From: Cyruz143 Date: Thu, 29 Aug 2019 19:47:33 +0100 Subject: [PATCH 08/11] Use existing strings for CBA options --- addons/cookoff/initSettings.sqf | 2 +- addons/cookoff/stringtable.xml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/cookoff/initSettings.sqf b/addons/cookoff/initSettings.sqf index 4c9745a1714..ce510a299d5 100644 --- a/addons/cookoff/initSettings.sqf +++ b/addons/cookoff/initSettings.sqf @@ -4,7 +4,7 @@ QGVAR(enable), "LIST", [LSTRING(enable_hd_name), LSTRING(enable_hd_tooltip)], LSTRING(category_displayName), - [[0, 1, 2], ["STR_A3_OPTIONS_DISABLED", "STR_A3_OPTIONS_ENABLED", LSTRING(enableForPlayers)], 0], + [[0, 1, 2], ["STR_A3_OPTIONS_DISABLED", ELSTRING(common,playerOnly), ELSTRING(common,playersAndAI)], 0], true, // isGlobal {[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index 4ed75ab0896..452b213fe9b 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -25,9 +25,6 @@ 誘爆の損傷処理と砲塔の爆発効果を変更します。 Изменяет обработку урона для возгорания и эффекта срыва башни - - Enable for player crewed vehicles - Wreck (Turret) Épave (tourelle) From 9e18a1d95908ebd38c787ace1af2fa497bc5566c Mon Sep 17 00:00:00 2001 From: Cyruz143 Date: Tue, 15 Oct 2019 15:49:18 +0100 Subject: [PATCH 09/11] Reverting change to support legacy eden attribute settings --- addons/cookoff/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf index 0202c438e14..1c93ee501cd 100644 --- a/addons/cookoff/XEH_postInit.sqf +++ b/addons/cookoff/XEH_postInit.sqf @@ -83,7 +83,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; // blow off turret effect ["Tank", "killed", { - if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] !=0) then { + if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)] in [1, 2, true]) then { if (random 1 < 0.15) then { (_this select 0) call FUNC(blowOffTurret); }; From fda83edacd47c97eb40c718d0f1f9d348c758deb Mon Sep 17 00:00:00 2001 From: Cyruz143 Date: Tue, 15 Oct 2019 16:02:59 +0100 Subject: [PATCH 10/11] Adding Pabsts fix for 3den attribute --- addons/cookoff/CfgEden.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cookoff/CfgEden.hpp b/addons/cookoff/CfgEden.hpp index caffc6b90ba..0d016f642cf 100644 --- a/addons/cookoff/CfgEden.hpp +++ b/addons/cookoff/CfgEden.hpp @@ -12,7 +12,7 @@ class Cfg3DEN { expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};); typeName = "BOOL"; condition = "objectVehicle"; - defaultValue = QUOTE(GETMVAR(QGVAR(enable),true)); + defaultValue = QUOTE((GETMVAR(QGVAR(enable),0)) in [1,2]); }; class GVAR(enableAmmoCookoff) { property = QGVAR(enableAmmoCookoff); From 842164d1246ebc539e45aefb3b93c8dcdd2da970 Mon Sep 17 00:00:00 2001 From: Cyruz143 Date: Tue, 15 Oct 2019 16:44:39 +0100 Subject: [PATCH 11/11] Update addons/cookoff/CfgEden.hpp Co-Authored-By: PabstMirror --- addons/cookoff/CfgEden.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cookoff/CfgEden.hpp b/addons/cookoff/CfgEden.hpp index 0d016f642cf..2b58daa3043 100644 --- a/addons/cookoff/CfgEden.hpp +++ b/addons/cookoff/CfgEden.hpp @@ -12,7 +12,7 @@ class Cfg3DEN { expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};); typeName = "BOOL"; condition = "objectVehicle"; - defaultValue = QUOTE((GETMVAR(QGVAR(enable),0)) in [1,2]); + defaultValue = QUOTE((GETMVAR(QGVAR(enable),0)) in [ARR_2(1,2)]); }; class GVAR(enableAmmoCookoff) { property = QGVAR(enableAmmoCookoff);