mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Fix old player_craftItem bug when using waterbottles for crafting
This commit is contained in:
@@ -85,8 +85,7 @@ if (_canDo) then {
|
|||||||
|
|
||||||
while {_craft_doLoop} do {
|
while {_craft_doLoop} do {
|
||||||
_temp_removed_array = [];
|
_temp_removed_array = [];
|
||||||
|
if ([_item,_selectedRecipeTools,"none"] call dze_requiredItemsCheck) then {
|
||||||
if ([_item,_selectedRecipeTools,"none"] call dze_requiredItemsCheck) then {
|
|
||||||
// Dry run to see if all parts are available.
|
// Dry run to see if all parts are available.
|
||||||
_proceed = true;
|
_proceed = true;
|
||||||
if (count _selectedRecipeInput > 0) then {
|
if (count _selectedRecipeInput > 0) then {
|
||||||
@@ -95,6 +94,7 @@ if (_canDo) then {
|
|||||||
_countIn = _x select 1;
|
_countIn = _x select 1;
|
||||||
|
|
||||||
_qty = { (_x == _itemIn) || (!_selectedRecipeInputStrict && {configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn})} count magazines player;
|
_qty = { (_x == _itemIn) || (!_selectedRecipeInputStrict && {configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn})} count magazines player;
|
||||||
|
|
||||||
if (_qty < _countIn) exitWith {
|
if (_qty < _countIn) exitWith {
|
||||||
_missing = _itemIn;
|
_missing = _itemIn;
|
||||||
_missingQty = (_countIn - _qty);
|
_missingQty = (_countIn - _qty);
|
||||||
@@ -129,6 +129,7 @@ if (_canDo) then {
|
|||||||
_removed_total = 0; // count total of removed items
|
_removed_total = 0; // count total of removed items
|
||||||
_tobe_removed_total = 0; // count total of all to be removed items
|
_tobe_removed_total = 0; // count total of all to be removed items
|
||||||
_waterLevel_lowest = 0; // find the lowest _waterLevel
|
_waterLevel_lowest = 0; // find the lowest _waterLevel
|
||||||
|
|
||||||
// Take items
|
// Take items
|
||||||
{
|
{
|
||||||
_removed = 0;
|
_removed = 0;
|
||||||
@@ -154,7 +155,7 @@ if (_canDo) then {
|
|||||||
{
|
{
|
||||||
_configParent = configName(inheritsFrom(configFile >> "cfgMagazines" >> _x));
|
_configParent = configName(inheritsFrom(configFile >> "cfgMagazines" >> _x));
|
||||||
if ((_removed < _countIn) && {(_x == _itemIn) || (!_selectedRecipeInputStrict && {_configParent == _itemIn})}) then {
|
if ((_removed < _countIn) && {(_x == _itemIn) || (!_selectedRecipeInputStrict && {_configParent == _itemIn})}) then {
|
||||||
if ((_waterLevel_lowest == 0) || ((_waterLevel_lowest > 0) && {getNumber(configFile >> "CfgMagazines" >> _x >> "wateroz") == _waterLevel_lowest})) then {
|
if ((_x != "ItemWaterbottle") || (_configParent != "ItemWaterbottle") || {(_waterLevel_lowest == 0) || ((_waterLevel_lowest > 0) && {getNumber(configFile >> "CfgMagazines" >> _x >> "wateroz") == _waterLevel_lowest})}) then {
|
||||||
_num_removed = ([player,_x] call BIS_fnc_invRemove);
|
_num_removed = ([player,_x] call BIS_fnc_invRemove);
|
||||||
} else {
|
} else {
|
||||||
_num_removed = 0;
|
_num_removed = 0;
|
||||||
@@ -172,8 +173,8 @@ if (_canDo) then {
|
|||||||
_temp_removed_array set [count _temp_removed_array,_x];
|
_temp_removed_array set [count _temp_removed_array,_x];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} foreach (magazines player);
|
} count (magazines player);
|
||||||
} count _selectedRecipeInput;
|
} foreach _selectedRecipeInput;
|
||||||
|
|
||||||
//diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
|
//diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
|
||||||
|
|
||||||
@@ -244,7 +245,7 @@ if (_canDo) then {
|
|||||||
format[localize "str_epoch_player_150",_textCreate,_countOut] call dayz_rollingMessages;
|
format[localize "str_epoch_player_150",_textCreate,_countOut] call dayz_rollingMessages;
|
||||||
// sleep here
|
// sleep here
|
||||||
uiSleep 1;
|
uiSleep 1;
|
||||||
} count _selectedRecipeOutput;
|
} foreach _selectedRecipeOutput;
|
||||||
|
|
||||||
_tradeComplete = _tradeComplete + 1;
|
_tradeComplete = _tradeComplete + 1;
|
||||||
};
|
};
|
||||||
@@ -293,4 +294,4 @@ if (_canDo) then {
|
|||||||
} else {
|
} else {
|
||||||
localize "str_epoch_player_64" call dayz_rollingMessages;
|
localize "str_epoch_player_64" call dayz_rollingMessages;
|
||||||
};
|
};
|
||||||
dayz_actionInProgress = false;
|
dayz_actionInProgress = false;
|
||||||
Reference in New Issue
Block a user