Skip to content

Commit 13fb246

Browse files
authored
Attributes - Add support for ACE Repair 'Enable' setting (#742)
1 parent 9ea2b6b commit 13fb246

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

addons/attributes/initAttributes.sqf

+19-15
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,23 @@ if (isClass (configFile >> "CfgPatches" >> "ace_medical")) then {
995995
] call FUNC(addAttribute);
996996
};
997997

998-
if (isClass (configFile >> "CfgPatches" >> "ace_repair")) then {
998+
private _hasAceRepair = isClass (configFile >> "CfgPatches" >> "ace_repair");
999+
1000+
[
1001+
"Traits",
1002+
"str_b_engineer_f0",
1003+
QGVAR(toolbox),
1004+
[1, 2, [ELSTRING(common,No), ELSTRING(common,Yes)]],
1005+
{
1006+
{
1007+
[QEGVAR(common,setUnitTrait), [_x, "engineer", _value], _x] call CBA_fnc_targetEvent;
1008+
} forEach call EFUNC(common,getSelectedUnits);
1009+
},
1010+
{_entity getUnitTrait "engineer"},
1011+
[{true}, {!(missionNamespace getVariable ["ace_repair_enabled", false])}] select _hasAceRepair
1012+
] call FUNC(addAttribute);
1013+
1014+
if (_hasAceRepair) then {
9991015
[
10001016
"Traits",
10011017
LSTRING(EngineeringSkill),
@@ -1006,20 +1022,8 @@ if (isClass (configFile >> "CfgPatches" >> "ace_repair")) then {
10061022
_x setVariable ["ACE_isEngineer", _value, true];
10071023
} forEach call EFUNC(common,getSelectedUnits);
10081024
},
1009-
{[0, 1, 2] select (_entity getVariable ["ACE_isEngineer", _entity getUnitTrait "engineer"])}
1010-
] call FUNC(addAttribute);
1011-
} else {
1012-
[
1013-
"Traits",
1014-
"str_b_engineer_f0",
1015-
QGVAR(toolbox),
1016-
[1, 2, [ELSTRING(common,No), ELSTRING(common,Yes)]],
1017-
{
1018-
{
1019-
[QEGVAR(common,setUnitTrait), [_x, "engineer", _value], _x] call CBA_fnc_targetEvent;
1020-
} forEach call EFUNC(common,getSelectedUnits);
1021-
},
1022-
{_entity getUnitTrait "engineer"}
1025+
{[0, 1, 2] select (_entity getVariable ["ACE_isEngineer", _entity getUnitTrait "engineer"])},
1026+
{missionNamespace getVariable ["ace_repair_enabled", false]}
10231027
] call FUNC(addAttribute);
10241028
};
10251029

0 commit comments

Comments
 (0)