From 8b3f28dc0c92830af2e7459fd3da6928fa8242a1 Mon Sep 17 00:00:00 2001 From: ebayShopper Date: Mon, 20 Mar 2017 18:18:04 -0400 Subject: [PATCH] Update player_sharpen.sqf Fixes extra knife being deleted if player already had a fully sharpened knife on their toolbelt (duplicate weapon). Vanilla commit: https://github.com/DayZMod/DayZ/commit/0332fcbe711b657723704fc9a4d5fd8f66f52b77 --- CHANGE LOG 1.0.6.2.txt | 1 + SQF/dayz_code/actions/player_sharpen.sqf | 17 +++++++++-------- SQF/dayz_code/compile/fn_addDuplicateTool.sqf | 4 ++-- SQF/dayz_code/compile/fn_dynamicTool.sqf | 1 + SQF/dayz_code/stringtable.xml | 16 ++++++++-------- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/CHANGE LOG 1.0.6.2.txt b/CHANGE LOG 1.0.6.2.txt index 844f22d43..950ba4f91 100644 --- a/CHANGE LOG 1.0.6.2.txt +++ b/CHANGE LOG 1.0.6.2.txt @@ -11,6 +11,7 @@ [FIXED] Removing a trap with no room in your gear will no longer delete the trap. [FIXED] Player_forceSave is now called correctly when the abort menu is opened. It was previously using the wrong variable and time. [FIXED] The unconscious wake up animation can no longer be skipped by using a bandage or other right click actions. +[FIXED] Sharpening a knife will no longer delete one if the player already had a fully sharpened knife on their toolbelt (duplicate weapon). [NOTE] Fixes below are included in the mission file and server pbo as part of server package 1.0.6.1A (March 10th 2017) [FIXED] Fixed food and drink going down 10x faster from melee and other "working" actions. diff --git a/SQF/dayz_code/actions/player_sharpen.sqf b/SQF/dayz_code/actions/player_sharpen.sqf index 94eef7ce5..41b224068 100644 --- a/SQF/dayz_code/actions/player_sharpen.sqf +++ b/SQF/dayz_code/actions/player_sharpen.sqf @@ -30,16 +30,17 @@ if (player hasWeapon _item) then { _displayName = getText (configFile >> "CfgWeapons" >> _item >> "displayName"); player removeMagazine _waterUsed; - Player removeWeapon _item; + player removeWeapon _item; - Player addWeapon _repair; + if !(player hasWeapon _repair) then { + player addWeapon _repair; + } else { + //Drop sharpened knife if player already has one. Prevents duplicate tool. + [_repair,2,1] call fn_dropItem; + format[localize "str_actions_noroom",_repair] call dayz_rollingMessages; + }; - if (_waterUsed in ["ItemWaterBottle","ItemWaterBottleInfected","ItemWaterBottleSafe","ItemWaterBottleBoiled","ItemWaterBottleHerbal"]) then { - player addMagazine "ItemWaterBottleUnfilled"; - }; - if (_waterUsed in ["ItemCanteen","ItemCanteenInfected","ItemCanteenSafe","ItemCanteenBoiled","ItemCanteenHerbal"]) then { - player addMagazine "ItemCanteenEmpty"; - }; + player addMagazine (getText(configFile >> "CfgMagazines" >> _waterUsed >> "containerEmpty")); //Remove Later player removeMagazine "equip_brick"; diff --git a/SQF/dayz_code/compile/fn_addDuplicateTool.sqf b/SQF/dayz_code/compile/fn_addDuplicateTool.sqf index c0802fb3c..0d7a73dd1 100644 --- a/SQF/dayz_code/compile/fn_addDuplicateTool.sqf +++ b/SQF/dayz_code/compile/fn_addDuplicateTool.sqf @@ -21,7 +21,7 @@ if (_this in items player) then { _bag addWeaponCargoGlobal [_this,1]; } else { [_this,2,1] call fn_dropItem; - systemChat format[localize "str_epoch_player_314",_this]; + systemChat format[localize "str_actions_noroom",_this]; }; } else { //Remove melee magazines (BIS_fnc_invAdd fix) @@ -30,7 +30,7 @@ if (_this in items player) then { if !([player,_this] call BIS_fnc_invAdd) then { systemChat localize "str_epoch_player_107"; [_this,2,1] call fn_dropItem; - systemChat format[localize "str_epoch_player_314",_this]; + systemChat format[localize "str_actions_noroom",_this]; }; true call dz_fn_meleeMagazines; }; \ No newline at end of file diff --git a/SQF/dayz_code/compile/fn_dynamicTool.sqf b/SQF/dayz_code/compile/fn_dynamicTool.sqf index 2c63c857c..c26979954 100644 --- a/SQF/dayz_code/compile/fn_dynamicTool.sqf +++ b/SQF/dayz_code/compile/fn_dynamicTool.sqf @@ -40,6 +40,7 @@ switch (_this select 0) do { //Drop dull knife or empty matchbox if player already has one. Prevents duplicate tool. player removeWeapon _remaining; [_remaining,2,1] call fn_dropItem; + format[localize "str_actions_noroom",_remaining] call dayz_rollingMessages; }; player addWeapon _remaining; }; diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index 7d5579b8d..a3026bb88 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -1402,6 +1402,14 @@ Vous n'avez plus de place. Tout est tombé sur le sol. Du hast keinen Platz mehr und lässt alles auf den Boden fallen. + + %1 is already in your inventory. Dropping on the ground! + %1 ist bereits in deinem Inventar. Fallenlassen auf den Boden! + %1 уже в вашем инвентаре. Сброшено на землю! + %1 is al in je inventaris. Het laten vallen op de grond! + %1 est déjà dans votre inventaire. Déposer sur le terrain! + %1 je již ve vašem inventáři. Pád na zem! + A hose would be needed to do this. Для этого нужен шланг. @@ -13285,14 +13293,6 @@ %1 est déjà dans votre inventaire. Ajout d'un sac à dos! %1 je již ve vašem inventáři. Přidání do batoh! - - %1 is already in your inventory. Dropping on the ground! - %1 ist bereits in deinem Inventar. Fallenlassen auf den Boden! - %1 уже в вашем инвентаре. Сброшено на землю! - %1 is al in je inventaris. Het laten vallen op de grond! - %1 est déjà dans votre inventaire. Déposer sur le terrain! - %1 je již ve vašem inventáři. Pád na zem! - %1 is restricted. %1 ist gesperrt.