ACE3/addons/repair/functions/fnc_isEngineer.sqf
PabstMirror a828ebe591
Repair - Disable repair on ERA/Slat armor hitpoints (#6283)
* Repair - Disable repair on ERA/Slat armor

Disable "miscRepair" action for all era and slat armor hitpoints.
Can still be repaired via "Full Repair"

* Minor perf improvment

* Add hitpoint names for 1.82 comTurret/gun

* Fix russian translations
2018-04-19 12:31:00 -05:00

29 lines
843 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]];
private _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.
if (_class isEqualType false) then {_class = [0, 1] select _class};
TRACE_3("isEngineer",_unit,_engineerN,_class);
_class >= _engineerN;