ACE3/addons/repair/functions/fnc_isEngineer.sqf
Glowbal 83f46be990 Fixes and improvements for the repair module
1. Added full repair,
2. Added missing settings to modules and settings framework,
3. added assign engineer module.
4. Fixed animation bug
2015-08-14 20:49:51 +02:00

26 lines
847 B
Plaintext

/*
* Author: Glowbal, KoffeinFlummi, commy2
* Check if a unit is any engineer class
*
* Arguments:
* 0: The Unit <OBJECT>
* 1: Class <NUMBER> <OPTIONAL>
*
* ReturnValue:
* Is in of engineer class <BOOL>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", ["_engineerN", 1]];
TRACE_2("params",_unit,_engineerN);
private ["_class"];
_class = _unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "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.
if (typeName _class == "BOOL") then {_class = 1};
_class >= (_engineerN min GVAR(engineerSetting_Repair));