2015-04-22 19:01:22 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal, KoffeinFlummi, commy2
|
|
|
|
* Check if a unit is any engineer class
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The Unit <OBJECT>
|
|
|
|
* 1: Class <NUMBER> <OPTIONAL>
|
|
|
|
*
|
|
|
|
* ReturnValue:
|
2015-07-03 21:14:23 +00:00
|
|
|
* Is in of engineer class <BOOL>
|
2015-04-22 19:01:22 +00:00
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-09 06:54:44 +00:00
|
|
|
params ["_unit", ["_engineerN", 1]];
|
|
|
|
TRACE_2("params",_unit,_engineerN);
|
2015-04-22 19:01:22 +00:00
|
|
|
|
2015-08-09 06:54:44 +00:00
|
|
|
private ["_class"];
|
2015-08-14 18:49:51 +00:00
|
|
|
_class = _unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer")];
|
2015-04-22 19:01:22 +00:00
|
|
|
|
2015-08-14 18:49:51 +00:00
|
|
|
// 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.
|
|
|
|
if (typeName _class == "BOOL") then {_class = 1};
|
2015-04-22 19:01:22 +00:00
|
|
|
|
2015-08-14 18:49:51 +00:00
|
|
|
_class >= (_engineerN min GVAR(engineerSetting_Repair));
|