2015-03-07 12:47:28 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Assign vehicle as a medical vehicle
|
2015-03-07 12:25:28 +00:00
|
|
|
*
|
2015-03-07 12:47:28 +00:00
|
|
|
* Arguments:
|
|
|
|
* 0: The module logic <LOGIC>
|
|
|
|
* 1: units <ARRAY>
|
|
|
|
* 2: activated <BOOL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-22 14:25:10 +00:00
|
|
|
* None
|
2015-03-07 12:47:28 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
2015-03-07 12:25:28 +00:00
|
|
|
*/
|
|
|
|
|
2015-03-07 12:47:28 +00:00
|
|
|
|
2015-03-07 12:25:28 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-22 14:25:10 +00:00
|
|
|
private ["_setting", "_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList"];
|
|
|
|
params [["_logic", objNull, [objNull]]];
|
2015-03-07 12:25:28 +00:00
|
|
|
|
|
|
|
if (!isNull _logic) then {
|
|
|
|
_list = _logic getvariable ["EnableList",""];
|
|
|
|
|
|
|
|
_splittedList = [_list, ","] call BIS_fnc_splitString;
|
|
|
|
_nilCheckPassedList = "";
|
|
|
|
{
|
|
|
|
_x = [_x] call EFUNC(common,stringRemoveWhiteSpace);
|
|
|
|
if !(isnil _x) then {
|
|
|
|
if (_nilCheckPassedList == "") then {
|
|
|
|
_nilCheckPassedList = _x;
|
|
|
|
} else {
|
|
|
|
_nilCheckPassedList = _nilCheckPassedList + ","+ _x;
|
|
|
|
};
|
|
|
|
};
|
2015-08-22 14:25:10 +00:00
|
|
|
} foreach _splittedList;
|
2015-03-07 12:25:28 +00:00
|
|
|
|
|
|
|
_list = "[" + _nilCheckPassedList + "]";
|
|
|
|
_parsedList = [] call compile _list;
|
2015-05-10 19:58:17 +00:00
|
|
|
_setting = _logic getvariable ["enabled", 0];
|
2015-03-07 12:25:28 +00:00
|
|
|
_objects = synchronizedObjects _logic;
|
|
|
|
if (!(_objects isEqualTo []) && _parsedList isEqualTo []) then {
|
|
|
|
{
|
|
|
|
if (!isnil "_x") then {
|
|
|
|
if (typeName _x == typeName objNull) then {
|
|
|
|
if (local _x) then {
|
2015-05-10 19:19:32 +00:00
|
|
|
_x setvariable [QGVAR(medicClass), _setting, true];
|
2015-03-07 12:25:28 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2015-08-22 14:25:10 +00:00
|
|
|
} foreach _objects;
|
2015-03-07 12:25:28 +00:00
|
|
|
};
|
|
|
|
{
|
|
|
|
if (!isnil "_x") then {
|
|
|
|
if (typeName _x == typeName objNull) then {
|
|
|
|
if (local _x) then {
|
2015-05-10 19:19:32 +00:00
|
|
|
_x setvariable [QGVAR(medicClass), _setting, true];
|
2015-03-07 12:25:28 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2015-08-22 14:25:10 +00:00
|
|
|
} foreach _parsedList;
|
2015-03-07 12:25:28 +00:00
|
|
|
};
|