From e2742ed18a5b0c84f2b5b5e3a2206abecc8c5371 Mon Sep 17 00:00:00 2001 From: ebayShopper Date: Mon, 13 Feb 2017 16:21:08 -0500 Subject: [PATCH] Fix add melee to full toolbelt eating weapon Melee weapons were eaten when trying to add them to a full toolbelt because BIS_fnc_invAdd failed. --- CHANGE LOG 1.0.6.1.txt | 1 + SQF/dayz_code/actions/player_addToolbelt.sqf | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGE LOG 1.0.6.1.txt b/CHANGE LOG 1.0.6.1.txt index 63a4a22be..49d726afc 100644 --- a/CHANGE LOG 1.0.6.1.txt +++ b/CHANGE LOG 1.0.6.1.txt @@ -78,6 +78,7 @@ [FIXED] Players can no longer walk under water at Topolka Dam. @Bruce-LXXVI [FIXED] server_PublishVehicle3 will no longer dupe a vehicle if it fails to read the vehicle back from the database. @oiad [FIXED] Panic sounds will no longer overlap when the player is attacked by zombies. #1861 @DeVloek +[FIXED] Melee weapons will no longer be eaten when attempting to add them to a full toolbelt. [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/player_addToolbelt.sqf b/SQF/dayz_code/actions/player_addToolbelt.sqf index 13bbb12c3..8b6bec497 100644 --- a/SQF/dayz_code/actions/player_addToolbelt.sqf +++ b/SQF/dayz_code/actions/player_addToolbelt.sqf @@ -7,6 +7,12 @@ _item = _this; _config = configFile >> "cfgWeapons" >> _item; _onBack = dayz_onBack in MeleeWeapons; +//Check if toolbelt is full before removing melee +if (getNumber (_config >> "type") == 1 && ({getNumber (configFile >> "CfgWeapons" >> _x >> "type") == 131072} count (weapons player)) >= 12) exitWith { + localize "str_player_24" call dayz_rollingMessages; + dayz_actionInProgress = false; +}; + _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; if (_onLadder) exitWith {localize "str_player_21" call dayz_rollingMessages; dayz_actionInProgress = false;};