Use getUnitTrait for medics, engineers and EOD (#5246)

This commit is contained in:
SilentSpike 2017-06-10 11:41:01 +01:00 committed by GitHub
parent 48b9a61497
commit a53f68a347
4 changed files with 4 additions and 4 deletions

View File

@ -20,4 +20,4 @@
params ["_unit"];
_unit getVariable ["ACE_isEOD", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "canDeactivateMines") == 1] // return
_unit getVariable ["ACE_isEOD", _unit getUnitTrait "explosiveSpecialist"] // return

View File

@ -17,7 +17,7 @@
params ["_unit"];
private _isEngineer = _unit getVariable ["ACE_isEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1];
private _isEngineer = _unit getVariable ["ACE_isEngineer", _unit getUnitTrait "engineer"];
//Handle ace_repair modules setting this to a number
if (_isEngineer isEqualType 0) then {_isEngineer = _isEngineer > 0};

View File

@ -19,7 +19,7 @@
params ["_unit", ["_medicN", 1]];
private _class = _unit getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "attendant")];
private _class = _unit getVariable [QGVAR(medicClass), [0, 1] select (_unit getUnitTrait "medic")];
if (_class >= _medicN min GVAR(medicSetting)) exitWith {true};
if (!GVAR(increaseTrainingInLocations)) exitWith {false};

View File

@ -20,7 +20,7 @@ params ["_unit", ["_engineerN", 1]];
TRACE_2("params",_unit,_engineerN);
private ["_class"];
_class = _unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer")];
_class = _unit getVariable ["ACE_IsEngineer", _unit getUnitTrait "engineer"];
// This if statement is here for copmatability with the common variant of isEngineer, which requires a bool.
// We cannot move this function to common because we require the GVAR(engineerSetting_Repair), which only makes sense to include in the repair module.