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.
This commit is contained in:
ebaydayz
2017-01-05 19:38:03 -05:00
parent d0257b3c7d
commit e074ef0d44
5 changed files with 13 additions and 15 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;
};
};
};

View File

@@ -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;
};