Hi i have this:
private _fnc_getStack = {
params [["_keys",[],[[]]], ["_values",[],[[]]]];
_merged = _keys apply {[_x,(_values select (_keys find _x))]};
_merged
//[["10Rnd_9x21_Mag","FirstAidKit"],[1,2]]
};
private _weapons = ((getWeaponCargo _vehicle) call _fnc_getStack);
private _mags = ((getMagazineCargo _vehicle) call _fnc_getStack);
private _items = ((getItemCargo _vehicle) call _fnc_getStack);
private _bags = ((getBackpackCargo _vehicle) call _fnc_getStack);
//[["10Rnd_9x21_Mag",1],["FirstAidKit",2]]
private _vehicleItems = [];
{
for "_i" from 1 to (_x # 1) do {
_vehicleItems pushBack (_x # 0);
};
} forEach (_weapons+_mags+_items+_bags);
//["10Rnd_9x21_Mag","FirstAidKit","FirstAidKit"]
It looks pretty ugly for me.
I wanna ask you guys if you have any idea how to write this better!