mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Fix for crafting multiple SledgeHammers
Revision of https://github.com/EpochModTeam/DayZ-Epoch/pull/1567 Thanks @Namindu
This commit is contained in:
@@ -221,34 +221,38 @@ if (_canDo) then {
|
|||||||
_craft_doLoop = false;
|
_craft_doLoop = false;
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
player addWeapon _x;
|
if ((_x == "ItemSledge") && {_x in items player}) then {
|
||||||
|
_bag = unitBackpack player;
|
||||||
|
if (!isNull _bag) then {
|
||||||
|
systemChat format[(localize "str_epoch_player_313"),_x];
|
||||||
|
_bag addWeaponCargoGlobal [_x,1];
|
||||||
|
} else {
|
||||||
|
systemChat format[(localize "str_epoch_player_314"),_x];
|
||||||
|
_object = createVehicle ["WeaponHolder",position player,[],0,"CAN_COLLIDE"];
|
||||||
|
_object setVariable ["permaLoot",true];
|
||||||
|
_object addWeaponCargoGlobal [_x,1];
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
player addWeapon _x;
|
||||||
|
};
|
||||||
} forEach _outputWeapons;
|
} forEach _outputWeapons;
|
||||||
{
|
{
|
||||||
|
|
||||||
_itemOut = _x select 0;
|
_itemOut = _x select 0;
|
||||||
_countOut = _x select 1;
|
_countOut = _x select 1;
|
||||||
|
|
||||||
if (_itemOut == "ItemWaterbottleUnfilled") then {
|
if (_itemOut == "ItemWaterbottleUnfilled") then {
|
||||||
|
|
||||||
if (_waterLevel > 0) then {
|
if (_waterLevel > 0) then {
|
||||||
_itemOut = format["ItemWaterbottle%1oz",_waterLevel];
|
_itemOut = format["ItemWaterbottle%1oz",_waterLevel];
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// diag_log format["Checking for water level: %1", _waterLevel];
|
// diag_log format["Checking for water level: %1", _waterLevel];
|
||||||
|
|
||||||
for "_x" from 1 to _countOut do {
|
for "_x" from 1 to _countOut do {
|
||||||
player addMagazine _itemOut;
|
player addMagazine _itemOut;
|
||||||
};
|
};
|
||||||
|
|
||||||
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
|
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
|
||||||
|
|
||||||
// Add crafted item
|
// Add crafted item
|
||||||
cutText [format[(localize "str_epoch_player_150"),_textCreate,_countOut], "PLAIN DOWN"];
|
cutText [format[(localize "str_epoch_player_150"),_textCreate,_countOut], "PLAIN DOWN"];
|
||||||
// sleep here
|
// sleep here
|
||||||
sleep 1;
|
sleep 1;
|
||||||
|
|
||||||
} forEach _selectedRecipeOutput;
|
} forEach _selectedRecipeOutput;
|
||||||
|
|
||||||
_tradeComplete = _tradeComplete+1;
|
_tradeComplete = _tradeComplete+1;
|
||||||
@@ -257,7 +261,6 @@ if (_canDo) then {
|
|||||||
} else {
|
} else {
|
||||||
// Refund parts since we failed
|
// Refund parts since we failed
|
||||||
{player addMagazine _x; } forEach _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"];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -285,4 +288,4 @@ if (_canDo) then {
|
|||||||
} else {
|
} else {
|
||||||
cutText [(localize "str_epoch_player_64"), "PLAIN DOWN"];
|
cutText [(localize "str_epoch_player_64"), "PLAIN DOWN"];
|
||||||
};
|
};
|
||||||
DZE_ActionInProgress = false;
|
DZE_ActionInProgress = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user