Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getUnitTrait for medics, engineers and EOD #5246

Merged
merged 2 commits into from Jun 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_isEOD.sqf
Expand Up @@ -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
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_isEngineer.sqf
Expand Up @@ -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};

Expand Down
2 changes: 1 addition & 1 deletion addons/medical/functions/fnc_isMedic.sqf
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion addons/repair/functions/fnc_isEngineer.sqf
Expand Up @@ -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.
Expand Down