diff --git a/addons/common/functions/fnc_isEngineer.sqf b/addons/common/functions/fnc_isEngineer.sqf index f01472dc028..20bda9bdd1d 100644 --- a/addons/common/functions/fnc_isEngineer.sqf +++ b/addons/common/functions/fnc_isEngineer.sqf @@ -1,10 +1,12 @@ #include "..\script_component.hpp" /* - * Author: marc_book, edited by commy2 + * Author: marc_book, commy2, DartRuffian * Checks if a unit is an engineer. * * Arguments: - * 0: unit to be checked + * 0: Unit to be checked + * 1: Engineer level (default: 1) + * - Only relevant if ace_repair is loaded * * Return Value: * is the unit an engineer @@ -15,10 +17,11 @@ * Public: Yes */ -params ["_unit"]; +params ["_unit", ["_engineerN", 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}; -_isEngineer +// Convert boolean to number +_isEngineer = [0, 1, 2] select _isEngineer; + +_isEngineer >= _engineerN diff --git a/addons/common/functions/fnc_isMedic.sqf b/addons/common/functions/fnc_isMedic.sqf index a5a70c6443e..61692632923 100644 --- a/addons/common/functions/fnc_isMedic.sqf +++ b/addons/common/functions/fnc_isMedic.sqf @@ -1,10 +1,12 @@ #include "..\script_component.hpp" /* - * Author: kymckay + * Author: kymckay, DartRuffian * Check if a unit is a medic * * Arguments: * 0: The Unit + * 1: Medic level (default: 1) + * - Only relevant if ace_medical is loaded * * Return Value: * Unit is medic @@ -15,8 +17,8 @@ * Public: Yes */ -params ["_unit"]; +params ["_unit", ["_medicN", 1]]; private _isMedic = _unit getVariable [QEGVAR(medical,medicClass), getNumber (configOf _unit >> "attendant")]; -_isMedic > 0 +_isMedic >= _medicN