2015-02-21 23:44:11 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Check if a unit is any medical class
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The Unit <OBJECT>
|
|
|
|
* 1: Class <NUMBER> <OPTIONAL>
|
|
|
|
*
|
|
|
|
* ReturnValue:
|
|
|
|
* Is in of medic class <BOOL>
|
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private ["_unit","_class","_return"];
|
|
|
|
_unit = _this select 0;
|
|
|
|
_medicN = if (count _this > 1) then {_this select 1} else {1};
|
|
|
|
|
2015-03-07 12:16:32 +00:00
|
|
|
_return = false;
|
|
|
|
if (GVAR(medicSetting) >= 1) then {
|
2015-02-21 23:44:11 +00:00
|
|
|
_class = _unit getvariable [QGVAR(medicClass), 0];
|
2015-03-07 12:16:32 +00:00
|
|
|
if (GVAR(medicSetting) == 1) then {
|
|
|
|
_return = _class > 0;
|
|
|
|
} else {
|
|
|
|
if (_class >= _medicN) then {
|
|
|
|
_return = true;
|
|
|
|
};
|
|
|
|
};
|
2015-02-21 23:44:11 +00:00
|
|
|
} else {
|
|
|
|
_return = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
_return;
|