27 lines
624 B
Plaintext
27 lines
624 B
Plaintext
#include "..\script_component.hpp"
|
|
|
|
params [
|
|
["_cfg", configNull, [configNull]],
|
|
["_code", {}, [{}]]
|
|
];
|
|
|
|
if (isNull _cfg) exitWith {["Provided config is null!"] call BIS_fnc_error};
|
|
|
|
|
|
private _recurseFnc = {
|
|
params ["_cfg", "_code", ["_recurseCounter", 0]];
|
|
[_cfg, _recurseCounter] call _code;
|
|
// get children and recurse
|
|
private _childCfgs = _cfg call BIS_fnc_returnChildren;
|
|
if (count _childCfgs isEqualTo 0) exitWith {false};
|
|
|
|
{
|
|
[_x, _code, _recurseCounter + 1] call _recurseFnc;
|
|
} forEach _childCfgs;
|
|
false;
|
|
};
|
|
|
|
private _continue = true;
|
|
while {_continue} do {
|
|
_continue = [_cfg, _code] call _recurseFnc;
|
|
}; |