revert counts here should fix #1318

This likely was causing issues with crafting also and (performance gain
is unknown)
This commit is contained in:
[VB]AWOL
2014-06-11 16:49:14 -05:00
parent db6c3ec6ac
commit 234b97f4b2

View File

@@ -95,7 +95,7 @@ if (_canDo) then {
{ {
_hastoolweapon = _x in weapons player; _hastoolweapon = _x in weapons player;
if(!_hastoolweapon) exitWith { _craft_doLoop = false; _missingTools = true; _missing = _x; }; if(!_hastoolweapon) exitWith { _craft_doLoop = false; _missingTools = true; _missing = _x; };
} count _selectedRecipeTools; } forEach _selectedRecipeTools;
if(!_missingTools) then { if(!_missingTools) then {
@@ -173,7 +173,7 @@ if (_canDo) then {
}; };
}; };
}; };
} count magazines player; } forEach magazines player;
{ {
_configParent = configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)); _configParent = configName(inheritsFrom(configFile >> "cfgMagazines" >> _x));
@@ -205,7 +205,7 @@ if (_canDo) then {
_num_removed_weapons = 0; _num_removed_weapons = 0;
{ {
_num_removed_weapons = _num_removed_weapons + ([player,_x] call BIS_fnc_invRemove); _num_removed_weapons = _num_removed_weapons + ([player,_x] call BIS_fnc_invRemove);
} count _inputWeapons; } forEach _inputWeapons;
if (_num_removed_weapons == (count _inputWeapons)) then { if (_num_removed_weapons == (count _inputWeapons)) then {
if(_randomOutput == 1) then { if(_randomOutput == 1) then {
_outputWeapons = []; _outputWeapons = [];
@@ -223,7 +223,7 @@ if (_canDo) then {
}; };
{ {
player addWeapon _x; player addWeapon _x;
} count _outputWeapons; } forEach _outputWeapons;
{ {
_itemOut = _x select 0; _itemOut = _x select 0;
@@ -250,14 +250,14 @@ if (_canDo) then {
// sleep here // sleep here
sleep 1; sleep 1;
} count _selectedRecipeOutput; } forEach _selectedRecipeOutput;
_tradeComplete = _tradeComplete+1; _tradeComplete = _tradeComplete+1;
}; };
} else { } else {
// Refund parts since we failed // Refund parts since we failed
{player addMagazine _x;} count _temp_removed_array; {player addMagazine _x; } forEach _temp_removed_array;
cutText [format[(localize "str_epoch_player_151"),_removed_total,_tobe_removed_total], "PLAIN DOWN"]; cutText [format[(localize "str_epoch_player_151"),_removed_total,_tobe_removed_total], "PLAIN DOWN"];
}; };