#include "..\script_component.hpp"

/*
 * Function: forge_client_misc_fnc_cargoToPairs
 * Author: IDSolutions
 *
 * [Description]
 * Converts a cargo array to an array of pairs.
 *
 * Arguments:
 * 0: Cargo Array <ARRAY>
 * 1: Optional: Second Array <ARRAY>
 *
 * Return Value:
 * Array of Pairs <ARRAY>
 *
 * Example:
 * [[1, 2, 3], [4, 5, 6]] call forge_client_misc_fnc_cargoToPairs;
 *
 * Public: Yes
 */

private _array = [];

if (count _this > 1) then {
    {
        _array pushBack [_x, (_this select 1) select _forEachIndex];
        true
    } count (_this select 0);
};

_array