From e074ef0d44de3f79c378682e6bd349ed82b666cd Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Thu, 5 Jan 2017 19:38:03 -0500 Subject: [PATCH] Fix rapid starvation and dehydration from chainsaw and chop wood Chainsaw is never used in player_chopWood.sqf. It is only called via right click on Hatchet which was removed anyway. The player already takes a nutrition hit on every swing of the hatchet, and it can take up to twelve swings to chop down one tree. --- CHANGE LOG 1.0.6.1.txt | 1 + SQF/dayz_code/actions/player_chopWood.sqf | 4 +--- SQF/dayz_code/actions/player_pushPlane.sqf | 4 ++-- SQF/dayz_code/compile/player_fired.sqf | 12 +++++++----- SQF/dayz_code/compile/player_harvest.sqf | 7 ++----- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/CHANGE LOG 1.0.6.1.txt b/CHANGE LOG 1.0.6.1.txt index dd0361c2f..830c2f6de 100644 --- a/CHANGE LOG 1.0.6.1.txt +++ b/CHANGE LOG 1.0.6.1.txt @@ -49,6 +49,7 @@ [FIXED] Duplicate matchbox or knife error when lighting a fire or gutting with multiple matchboxes or knives on toolbelt. #1849 @DeVloek [FIXED] RU crates having zero cargo capacity and wrong classname DZ_ExplosivesBoxRU in loot table. #1852 @oiad [FIXED] Combining M24 or 2Rnd shotgun ammo can no longer be abused to dupe mags via the method described in #1848. @DeVloek +[FIXED] Rapid starvation or dehydration when using chainsaw, chopping wood or pushing plane. [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_chopWood.sqf b/SQF/dayz_code/actions/player_chopWood.sqf index 7987017e7..afb1d73ab 100644 --- a/SQF/dayz_code/actions/player_chopWood.sqf +++ b/SQF/dayz_code/actions/player_chopWood.sqf @@ -39,9 +39,7 @@ if (count _findNearestTree > 0) then { [player,_dis,true,(getPosATL player)] call player_alertZombies; // Working-Factor for chopping wood. - if (!((primaryWeapon player) in ["ChainSaw","ChainSawB","ChainSawG","ChainSawP","ChainSawR"])) then { - ["Working",0,[50,10,5,0]] call dayz_NutritionSystem; - }; + ["Working",0,[50,10,5,0]] call dayz_NutritionSystem; r_interrupt = false; _animState = animationState player; diff --git a/SQF/dayz_code/actions/player_pushPlane.sqf b/SQF/dayz_code/actions/player_pushPlane.sqf index 48ad16fdd..aa3d4e2e1 100644 --- a/SQF/dayz_code/actions/player_pushPlane.sqf +++ b/SQF/dayz_code/actions/player_pushPlane.sqf @@ -23,5 +23,5 @@ _object setVelocity [ // Alert Zombies [player,20,true,(getPosATL player)] call player_alertZombies; -// Added Nutrition-Factor for work -["Working",0,[0,1,3,0]] call dayz_NutritionSystem; +//Player can push in rapid succession resulting in quick dehydration or starvation +//["Working",0,[0,1,3,0]] call dayz_NutritionSystem; \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_fired.sqf b/SQF/dayz_code/compile/player_fired.sqf index f6e721061..4fe6bef01 100644 --- a/SQF/dayz_code/compile/player_fired.sqf +++ b/SQF/dayz_code/compile/player_fired.sqf @@ -15,10 +15,12 @@ dayz_disAudial = _distance; dayz_firedCooldown = time; if (_ammo isKindOf "Melee") exitWith { - // Added Nutrition-Factor for work - //[Type,Blood[Calories,Hunger,Thrist,Temp] - ["Working",0,[0,3,5,0]] call dayz_NutritionSystem; - if !(_ammo isKindOf "Chainsaw_Swing_Ammo") then {_unit playActionNow "GestureSwing";}; + if (_ammo != "Chainsaw_Swing_Ammo") then { + // Added Nutrition-Factor for work + //[Type,Blood[Calories,Hunger,Thrist,Temp] + ["Working",0,[0,3,5,0]] call dayz_NutritionSystem; + _unit playActionNow "GestureSwing"; + }; _this call player_harvest; // harvest wood check }; @@ -102,4 +104,4 @@ if ((_ammo isKindOf "SmokeShell") or (_ammo isKindOf "GrenadeHandTimedWest") or //Auto select main weapon after throwing call player_selectWeapon; }; -}; \ No newline at end of file +}; diff --git a/SQF/dayz_code/compile/player_harvest.sqf b/SQF/dayz_code/compile/player_harvest.sqf index 90404667b..af7c32e37 100644 --- a/SQF/dayz_code/compile/player_harvest.sqf +++ b/SQF/dayz_code/compile/player_harvest.sqf @@ -4,8 +4,7 @@ _weapon = _this select 1; _ammo = _this select 4; _projectile = _this select 6; -if (_ammo isKindOf "Hatchet_Swing_Ammo" || _ammo isKindOf "Chainsaw_Swing_Ammo") then { - +if (_ammo in ["Hatchet_Swing_Ammo","Chainsaw_Swing_Ammo"]) then { _findNearestTree = []; { if (("" == typeOf _x) && {alive _x}) then { @@ -33,13 +32,11 @@ if (_ammo isKindOf "Hatchet_Swing_Ammo" || _ammo isKindOf "Chainsaw_Swing_Ammo") PVDZ_objgather_Knockdown = [_tree,player]; // Ask server to setDamage on tree publicVariableServer "PVDZ_objgather_Knockdown"; }; - _itemOut = if (_ammo isKindOf "Chainsaw_Swing_Ammo") then {"PartWoodLumber"} else {"PartWoodPile"}; // Log can be crafted to > 2x plank > 4x woodpile + _itemOut = if (_ammo == "Chainsaw_Swing_Ammo") then {"PartWoodLumber"} else {"PartWoodPile"}; // Log can be crafted to > 2x plank > 4x woodpile [_itemOut,1,1] call fn_dropItem; _distance = 60; [player,_distance,false,getPosATL player] spawn player_alertZombies; - // Working-Factor for chopping wood. - ["Working",0,[20,15,10,0]] call dayz_NutritionSystem; }; DZE_TEMP_treedmg = _damage; };