From 92d6257b92cf3f28f4939a9e99c0efe4001ddcf5 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Sat, 29 Oct 2016 16:05:08 -0400 Subject: [PATCH] Updated humanity Regen when under 1 Vanilla commit: https://github.com/DayZMod/DayZ/commit/8e844e2b6302d1682ff8653a00df8604be1c8b76 --- .../compile/player_humanityChange.sqf | 1 + SQF/dayz_code/system/player_spawn_2.sqf | 29 ++++--------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/SQF/dayz_code/compile/player_humanityChange.sqf b/SQF/dayz_code/compile/player_humanityChange.sqf index 6f5c730e1..71bc68260 100644 --- a/SQF/dayz_code/compile/player_humanityChange.sqf +++ b/SQF/dayz_code/compile/player_humanityChange.sqf @@ -4,6 +4,7 @@ _wait = _this select 1; _humanity = (player getVariable["humanity",0]) + _change; player setVariable["humanity",_humanity,true]; + if (_change < 0) then { //non-bandit player can be "punished" in next "_wait" seconds w/o loosing humanity if ((_humanity > -2000) and (_wait > 0)) then { // player setVariable ["freeTarget",true,true]; diff --git a/SQF/dayz_code/system/player_spawn_2.sqf b/SQF/dayz_code/system/player_spawn_2.sqf index 32417aa7d..c0c3c36e0 100644 --- a/SQF/dayz_code/system/player_spawn_2.sqf +++ b/SQF/dayz_code/system/player_spawn_2.sqf @@ -76,29 +76,12 @@ while {1 == 1} do { }; if (_timeOut > 150) then { - _humanity = player getVariable ["humanity",0]; - if (_humanity < 1 or _forceHumanity) then { - if (vehicle player != player) then { - [round(_timeOut / 10),0] call player_humanityChange; - _forceHumanity = false; - } else { - _humanity = _humanity + round(_timeOut / 10); - player setVariable["humanity",_humanity,true]; - _forceHumanity = true; - }; - }; - _timeOut = 0; - }; - -/* - if ((Dayz_loginCompleted) && (diag_tickTime < 25)) then { - - [0,0] call player_humanityChange; - - diag_log ("Running"); - _timer10 = diag_Ticktime; - }; -*/ + _humanity = player getVariable ["humanity",0]; + if (_humanity < 1) then { + [round(_timeOut / 10),0] call player_humanityChange; + }; + _timeOut = 0; + }; //reset OpenTarget variable if the timer has run out. if (OpenTarget_Time > 0 && {diag_tickTime - OpenTarget_Time >= dayz_OpenTarget_TimerTicks}) then