From 78b655bc1f8eb588611e4f03e3e770e4114641ab Mon Sep 17 00:00:00 2001 From: Dystopian Date: Thu, 22 Dec 2016 01:41:16 +0300 Subject: [PATCH] Simplify config crawling --- .../functions/fnc_exportConfig.sqf | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/optionals/nouniformrestrictions/functions/fnc_exportConfig.sqf b/optionals/nouniformrestrictions/functions/fnc_exportConfig.sqf index 81d4b0b438..f5e3d0cb8b 100644 --- a/optionals/nouniformrestrictions/functions/fnc_exportConfig.sqf +++ b/optionals/nouniformrestrictions/functions/fnc_exportConfig.sqf @@ -18,19 +18,15 @@ private _modifyClasses = []; private _baseClasses = []; { - if ((_x >> "modelSides") in (configProperties [_x, "true", false])) then { - private _modifyClass = { - if (!isNull (_x >> "modelSides")) exitWith {_x}; - } forEach (configHierarchy _x); - private _baseClass = inheritsFrom _modifyClass; - _modifyClasses pushBackUnique [_modifyClass, _baseClass]; - if !(_baseClass in (_modifyClasses apply {_x select 0})) then { - _baseClasses pushBackUnique _baseClass; - }; + private _baseClass = inheritsFrom _x; + _modifyClasses pushBackUnique [_x, _baseClass]; + if !(_baseClass in (_modifyClasses apply {_x select 0})) then { + _baseClasses pushBackUnique _baseClass; }; false } count ( ("!isNull (_x >> 'modelSides') &&" + + "{(_x >> 'modelSides') in (configProperties [_x, 'true', false])} &&" + "{!(getArray (_x >> 'modelSides') isEqualTo [6])} &&" + "{!(getArray (_x >> 'modelSides') isEqualTo [0,1,2,3])}") configClasses (configFile >> "CfgVehicles")