From 4fa36dfd94b0bbfc63a14bb28035a692101dd1b1 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Sat, 31 Dec 2016 17:14:08 -0500 Subject: [PATCH] Fix selling of Javelin, Stinger and some other items Fixes #1844 --- CHANGE LOG 1.0.6.1.txt | 1 + .../AdvancedTrading/functions/z_at_checkArrayInConfig.sqf | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGE LOG 1.0.6.1.txt b/CHANGE LOG 1.0.6.1.txt index f2111fc89..3a085e833 100644 --- a/CHANGE LOG 1.0.6.1.txt +++ b/CHANGE LOG 1.0.6.1.txt @@ -37,6 +37,7 @@ [FIXED] Generator inventory not saving #1831 @icomrade @schwanzkopfhegel [FIXED] Filling fuel barrels takes the correct amount from fuel tanks now (210 instead of 40 litres). #1834 @schwanzkopfhegel @oiad [FIXED] Base objects duplicating when using "take ownership" on plot pole. #1811 @BNG-Lance @Clanwarfare +[FIXED] Unable to sell some launchers like Javelin and Stinger which have the same classname for ammo and weapon. #1844 @ndavalos [NOTE] The fixes below are included in the 1.0.6 Build C server package released December 29th, 2016 (http://dayzepoch.com/a2dayzepoch.php) [FIXED] Hive child 309 errors that resulted in broken saving of newly built storage object inventory. @icomrade diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_checkArrayInConfig.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_checkArrayInConfig.sqf index a1b3a79d5..1529a47bc 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_checkArrayInConfig.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_checkArrayInConfig.sqf @@ -67,6 +67,8 @@ _totalPrice = 0; _pic = ""; _text = ""; _type = getText(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "type"); + // Make sure type matches for items that have the same weapon and magazine classname (i.e. PipeBomb, Mine, Javelin, etc.) + if ((_type == "trade_items" && !(_y in _mags)) or (_type == "trade_weapons" && !(_y in _weaps))) exitWith {}; _sell = getArray(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "sell"); _buy = getArray(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "buy"); if (_swap) then {_y = "ItemBloodbag"};