#include "script_component.hpp" /* * Author: Vdauphin * Check if an item will fit in the empty space already used by loaded items. * * Arguments: * 0: Vehicle * 1: Item * 2: Items from vehicle cargo * * Return Value: * Will fit or not the space occupied by items * * Example: * [] call ace_cargo_fnc_canItemCargo * * Public: No */ params [ "_vehicle", "_item", ["_items", [], [[]]] ]; if ( _items isEqualTo [] || {!((_vehicle canVehicleCargo _item) select 1)} ) exitWith {false}; private _itemSurface = [_item] call FUNC(getSurfaceItem); private _itemsSurface = 0; { _itemsSurface = _itemsSurface + ([_item] call FUNC(getSurfaceItem)); } forEach _items; _itemSurface <= _itemsSurface