ACE3/addons/repair/functions/fnc_isEngineer.sqf
PabstMirror 4e93b9c72d 2307 - Repair sub-turrets
Privates

Cleanup debug

Add repair actions for sub turrets

Cleanup

Fix Header

Error Handling

Cleanup setHitpointDamage

Fix common ACE_isEngineer to handle scalar or bool

Claim and release repair objects (wheel/track)

Repair sub-turrets
2015-11-20 21:11:05 -06:00

30 lines
920 B
Plaintext

/*
* Author: Glowbal, KoffeinFlummi, commy2
* Check if a unit is any engineer class.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Class <NUMBER> (default: 1)
*
* Return Value:
* Is Engineer Class <BOOL>
*
* Example:
* [unit, 1] call ace_repair_fnc_isEngineer
*
* 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 = [0, 1] select _class};
_class >= (_engineerN min GVAR(engineerSetting_Repair));