@@ -6,37 +6,39 @@ _numitems = 0;
66 _d = warehouse getVariable [_x ,[_x ,0 ]];
77 if (typename _d == " ARRAY" ) then {
88 _cls = _d select 0 ;
9- _num = _d select 1 ;
10- _name = " " ;
11- _pic = " " ;
9+ if (typename _cls ! = " CODE" ) then {
10+ _num = _d select 1 ;
11+ _name = " " ;
12+ _pic = " " ;
1213
13- if (_num > 0 ) then {
14- _numitems = _numitems + 1 ;
15- call {
16- if (_cls isKindOf [" Default" ,configFile >> " CfgWeapons" ]) exitWith {
17- _name = _cls call OT_fnc_weaponGetName ;
18- _pic = _cls call OT_fnc_weaponGetPic ;
19- };
20- if (_cls isKindOf [" Default" ,configFile >> " CfgMagazines" ]) exitWith {
21- _name = _cls call OT_fnc_magazineGetName ;
22- _pic = _cls call OT_fnc_magazineGetPic ;
23- };
24- if (_cls isKindOf " Bag_Base" ) exitWith {
14+ if (_num > 0 ) then {
15+ _numitems = _numitems + 1 ;
16+ call {
17+ if (_cls isKindOf [" Default" ,configFile >> " CfgWeapons" ]) exitWith {
18+ _name = _cls call OT_fnc_weaponGetName ;
19+ _pic = _cls call OT_fnc_weaponGetPic ;
20+ };
21+ if (_cls isKindOf [" Default" ,configFile >> " CfgMagazines" ]) exitWith {
22+ _name = _cls call OT_fnc_magazineGetName ;
23+ _pic = _cls call OT_fnc_magazineGetPic ;
24+ };
25+ if (_cls isKindOf " Bag_Base" ) exitWith {
26+ _name = _cls call OT_fnc_vehicleGetName ;
27+ _pic = _cls call OT_fnc_vehicleGetPic ;
28+ };
29+ if (isClass (configFile >> " CfgGlasses" >> _cls )) exitWith {
30+ _name = gettext(configFile >> " CfgGlasses" >> _cls >> " displayName" );
31+ _pic = gettext(configFile >> " CfgGlasses" >> _cls >> " picture" );
32+ };
2533 _name = _cls call OT_fnc_vehicleGetName ;
2634 _pic = _cls call OT_fnc_vehicleGetPic ;
2735 };
28- if (isClass (configFile >> " CfgGlasses" >> _cls )) exitWith {
29- _name = gettext(configFile >> " CfgGlasses" >> _cls >> " displayName" );
30- _pic = gettext(configFile >> " CfgGlasses" >> _cls >> " picture" );
31- };
32- _name = _cls call OT_fnc_vehicleGetName ;
33- _pic = _cls call OT_fnc_vehicleGetPic ;
34- };
3536
36- _idx = lbAdd [1500 ,format [" %1 x %2" ,_num ,_name ]];
37- lbSetPicture [1500 ,_idx ,_pic ];
38- lbSetValue [1500 ,_idx ,_num ];
39- lbSetData [1500 ,_idx ,_cls ];
37+ _idx = lbAdd [1500 ,format [" %1 x %2" ,_num ,_name ]];
38+ lbSetPicture [1500 ,_idx ,_pic ];
39+ lbSetValue [1500 ,_idx ,_num ];
40+ lbSetData [1500 ,_idx ,_cls ];
41+ };
4042 };
4143 };
4244}foreach (_sorted );
0 commit comments