From 5ca182dffee40c142d31088fd118a1f9f43ee7cc Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Mon, 9 May 2016 14:10:20 -0400 Subject: [PATCH] Fix can't sell satchels with Adv. Trade Some items (like PipeBomb) are a class in both CfgMagazines and CfgWeapons. BIS_fnc_invRemove uses weapon first, so that is why the magazine was not being removed. Using config instead of string avoids this problem. --- .../actions/AdvancedTrading/functions/z_at_sellItems.sqf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_sellItems.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_sellItems.sqf index 47c852e21..5ec3786b2 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_sellItems.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_sellItems.sqf @@ -154,7 +154,11 @@ if(_index > -1)then{ _localResult = if (_bag != (unitBackpack player)) then {1} else {0}; if (_localResult == 1) then {_bagTraded = true;}; } else { - _localResult = [player,(_x select 0),1] call BIS_fnc_invRemove; + _name = _x select 0; + _type = _x select 1; + if (_type == "trade_items") then {_name = configFile >> "CfgMagazines" >> _name;}; + if (_type == "trade_weapons") then {_name = configFile >> "CfgWeapons" >> _name;}; + _localResult = [player,_name,1] call BIS_fnc_invRemove; // Use config for BIS_fnc_invRemove if(_localResult != 1)then{ if(_x select 1 == "trade_items")then{ _mA set [count(_mA),0];