@@ -995,7 +995,23 @@ if (isClass (configFile >> "CfgPatches" >> "ace_medical")) then {
995
995
] call FUNC(addAttribute);
996
996
};
997
997
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 {
999
1015
[
1000
1016
" Traits" ,
1001
1017
LSTRING(EngineeringSkill),
@@ -1006,20 +1022,8 @@ if (isClass (configFile >> "CfgPatches" >> "ace_repair")) then {
1006
1022
_x setVariable [" ACE_isEngineer" , _value , true ];
1007
1023
} forEach call EFUNC(common,getSelectedUnits);
1008
1024
},
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 ]}
1023
1027
] call FUNC(addAttribute);
1024
1028
};
1025
1029
0 commit comments