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.
This commit is contained in:
ebaydayz
2016-10-06 19:13:46 -04:00
parent 7909f0089f
commit b193ad925a

View File

@@ -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. //Overkill logging. PVS network send every two seconds = lag. Not worth it just for extra anticheat logs.
//Log to server :-( OverProcessing really not needed. //Log to server :-( OverProcessing really not needed.
/*if (((!(isNil {_source})) AND {(!(isNull _source))}) AND {(_isMan AND {(!local _source)})}) then { /*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 == "RunOver"): {"runover"};
case (_ammo == "Dragged"): {"eject"}; case (_ammo == "Dragged"): {"eject"};
case (_ammo in MeleeAmmo): {"melee"}; 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 //(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"}; default {"none"};
}; };
if (dayz_lastDamageSource != "none") then {dayz_lastDamageTime = diag_tickTime;}; if (dayz_lastDamageSource != "none") then {dayz_lastDamageTime = diag_tickTime;};