From 1964a084ff8d5c716189d659f539c7e57ba88cca Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Mon, 17 Oct 2016 14:52:29 -0400 Subject: [PATCH] Avoid sending humanity hit if source is local We only want to send a humanity hit if the source is a remote player. Note it's not necessary to check isNull since (isPlayer objNull) returns false. Vanilla commit: https://github.com/DayZMod/DayZ/commit/7402b240df8dadd0e11f95885721cd0e7de87599 --- SQF/dayz_code/compile/fn_damageHandler.sqf | 2 +- SQF/dayz_code/compile/player_death.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SQF/dayz_code/compile/fn_damageHandler.sqf b/SQF/dayz_code/compile/fn_damageHandler.sqf index 014f09b3b..943884509 100644 --- a/SQF/dayz_code/compile/fn_damageHandler.sqf +++ b/SQF/dayz_code/compile/fn_damageHandler.sqf @@ -85,7 +85,7 @@ if (_unit == player) then { if (_hit == "" && _ammo != "Crash") exitWith //Ignore none part dmg. Exit after processing humanity hit. Don't punish driver for damaging passenger in crash { - if (_source != player && _isPlayer && alive player) then + if (!local _source && _isPlayer && alive player) then { _isBandit = (player getVariable["humanity",0]) <= -5000; //_isBandit = (_model in ["Bandit1_DZ","BanditW1_DZ"]); diff --git a/SQF/dayz_code/compile/player_death.sqf b/SQF/dayz_code/compile/player_death.sqf index 27aaa7469..1a130d8ca 100644 --- a/SQF/dayz_code/compile/player_death.sqf +++ b/SQF/dayz_code/compile/player_death.sqf @@ -80,7 +80,7 @@ _array = _this; if (count _array > 0) then { _source = _array select 0; _method = _array select 1; - if (!isNull _source && _source != player && isPlayer _source) then { //Don't send humanity hit to AI units + if (!local _source && isPlayer _source) then { _isBandit = (player getVariable["humanity",0]) <= -2000; //_isBandit = (_model in ["Bandit1_DZ","BanditW1_DZ"]);