From b551a6f34350a1ad33b6a8fcbef54a8b07873e83 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Sun, 26 Jan 2014 11:49:03 -0600 Subject: [PATCH] should allow crafting weapons only --- SQF/dayz_code/actions/player_craftItem.sqf | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/SQF/dayz_code/actions/player_craftItem.sqf b/SQF/dayz_code/actions/player_craftItem.sqf index 476ebae45..1650fbeeb 100644 --- a/SQF/dayz_code/actions/player_craftItem.sqf +++ b/SQF/dayz_code/actions/player_craftItem.sqf @@ -99,15 +99,17 @@ if (_canDo) then { // Dry run to see if all parts are available. _proceed = true; - { - _itemIn = _x select 0; - _countIn = _x select 1; + if (count _selectedRecipeInput > 0) then { + { + _itemIn = _x select 0; + _countIn = _x select 1; - _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player; + _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player; - if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; }; + if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; }; - } forEach _selectedRecipeInput; + } forEach _selectedRecipeInput; + }; // If all parts proceed if (_proceed) then {