Jump to content
Sign in to follow this  
gamerpaddy-198acb6499a94cd8

Waste Dump Trader doesnt account for Items in Sub-Inventories

Recommended Posts

Waste dump doesnt give you poptabs for objects within subinventories like in backpacks that are inside the crate or vehicle you are selling.

 

adding this to the

Quote

ExileClient_util_containerCargo_list.sqf

may break something but it does what its supposed to, just with a depth of 1 and not recursive. (objects in backpack in crate not any deeper)

_subcontainers = everyContainer  _container;
if !(isNil "_subcontainers") then
{
	for "_i" from 0 to count _subcontainers -1 do
	{
		_subcontainer =  (_subcontainers select _i select 1);
		_subitems = getItemCargo _subcontainer;
		_subweapons = weaponsItemsCargo _subcontainer;
		_submagazines = magazineCargo _subcontainer;
		_subbackpacks = backpackCargo _subcontainer;
		if !(isNil "_subitems") then
		{
				{
					_itemClassName = (_subitems select 0) select _forEachIndex;
					_itemQuantity = (_subitems select 1) select _forEachIndex;
					for "_i2" from 1 to _itemQuantity do
					{
						_list pushBack _itemClassName;
					};
				}
				forEach (_subitems select 0);
		};
		if !(isNil "_subweapons") then
		{
			{
				{
					_itemClassName = "";
					if ((typeName _x) isEqualTo "STRING") then
					{
						_itemClassName = _x;
					}
					else 
					{
						_itemClassName = _x select 0;
					};
					if !(_itemClassName isEqualTo "") then
					{
						_list pushBack _itemClassName;
					};
				}
				forEach _x;
			} 
			forEach _subweapons;
		};
		if !(isNil "_submagazines") then
		{
			_list append _submagazines;
		};
		if !(isNil "_subbackpacks") then
		{
			_list append _subbackpacks;
		};
	};
};

 

a different way, to leave ExileClient_util_containerCargo_list untouched is making a second script called ExileClient_util_containerCargoAll_list

and changing the

_cargo = _vehicleObject call ExileClient_util_containerCargo_list;

to

_cargo = _vehicleObject call ExileClient_util_containerCargoAll_list;

in ExileServer_system_trading_network_wasteDumpRequest.sqf

 

 

i got no experience in sqf scripting besides this abomination, someone with more experience could implement this properly, maybe even recursively and without stuff breaking.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×