From 8603f2062af671cea9e5dfaa468a104defdd22a8 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 6 Mar 2016 07:14:43 +0100 Subject: [PATCH] simplify --- addons/inventory/XEH_postInit.sqf | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/addons/inventory/XEH_postInit.sqf b/addons/inventory/XEH_postInit.sqf index c6ddaf4700..7135383734 100644 --- a/addons/inventory/XEH_postInit.sqf +++ b/addons/inventory/XEH_postInit.sqf @@ -22,27 +22,14 @@ private _fnc_addToCache = { GVAR(ItemKeyNamespace) setVariable [format ["%1:%2", _displayName, _picture], _this]; }; -// weapons and items -{ - if (getNumber (_x >> "scope") > 0) then {_x call _fnc_addToCache}; - false -} count ( - ("true" configClasses (configFile >> "CfgWeapons")) + - ("true" configClasses (configFile >> "CfgGlasses")) -); +private _allItems = []; -// magazines -{ - if (getNumber (_x >> "scope") == 2) then {_x call _fnc_addToCache}; - false -} count ("true" configClasses (configFile >> "CfgMagazines")); - -// backpacks -{ - if (getNumber (_x >> "scope") > 0 && {getNumber (_x >> "isBackpack") == 1}) then {_x call _fnc_addToCache}; - false -} count ("true" configClasses (configFile >> "CfgVehicles")); +_allItems append ("getNumber (_x >> 'scope') > 0" configClasses (configFile >> "CfgWeapons")); +_allItems append ("getNumber (_x >> 'scope') > 0" configClasses (configFile >> "CfgGlasses")); +_allItems append ("getNumber (_x >> 'scope') == 2" configClasses (configFile >> "CfgMagazines")); +_allItems append ("getNumber (_x >> 'scope') > 0 && {getNumber (_x >> 'isBackpack') == 1}" configClasses (configFile >> "CfgVehicles")); +{_x call _fnc_addToCache; false} count _allItems; GVAR(customFilters) = []; GVAR(selectedFilterIndex) = -1;