From b193ad925aad66b2f989b695167908dd4f0ec0e5 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Thu, 6 Oct 2016 19:13:46 -0400 Subject: [PATCH] Use more efficient check for "shot" death message Most of the time the source will be local (zombie) or player (physics). The next most common will be getting shot by a remote player, the least common will be getting shot by a remote vehicle. --- SQF/dayz_code/compile/fn_damageHandler.sqf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/SQF/dayz_code/compile/fn_damageHandler.sqf b/SQF/dayz_code/compile/fn_damageHandler.sqf index 7594004fb..661b2ae23 100644 --- a/SQF/dayz_code/compile/fn_damageHandler.sqf +++ b/SQF/dayz_code/compile/fn_damageHandler.sqf @@ -151,7 +151,7 @@ if (_unit == player) then { }; }; }; - + //Overkill logging. PVS network send every two seconds = lag. Not worth it just for extra anticheat logs. //Log to server :-( OverProcessing really not needed. /*if (((!(isNil {_source})) AND {(!(isNull _source))}) AND {(_isMan AND {(!local _source)})}) then { @@ -183,9 +183,8 @@ if (_unit == player) then { case (_ammo == "RunOver"): {"runover"}; case (_ammo == "Dragged"): {"eject"}; case (_ammo in MeleeAmmo): {"melee"}; - case (_isMan && !local _source && !(currentWeapon _source in ["","Throw"])): {"shot"}; //(vehicle _source != _source) does not work to detect if source unit is in a vehicle in HandleDamage EH - case (_sourceVehicleType isKindOf "LandVehicle" or _sourceVehicleType isKindOf "Air" or _sourceVehicleType isKindOf "Ship"): {"shot"}; + case (!local _source && {(_isMan && !(currentWeapon _source in ["","Throw"])) or {_sourceVehicleType isKindOf "LandVehicle" or _sourceVehicleType isKindOf "Air" or _sourceVehicleType isKindOf "Ship"}}): {"shot"}; default {"none"}; }; if (dayz_lastDamageSource != "none") then {dayz_lastDamageTime = diag_tickTime;};