diff --git a/SQF/dayz_code/compile/player_zombieAttack.sqf b/SQF/dayz_code/compile/player_zombieAttack.sqf index 2640389b8..e8adcb373 100644 --- a/SQF/dayz_code/compile/player_zombieAttack.sqf +++ b/SQF/dayz_code/compile/player_zombieAttack.sqf @@ -7,6 +7,8 @@ _targets = _unit getVariable ["targets",[]]; if (!dayz_zedsAttackVehicles and !(_vehicle in _targets)) exitWith {}; +if ((speed _vehicle > 10)) exitWith {}; + //Do the attack if (r_player_unconscious && _vehicle == player && _type == "zombie") then { _rnd = (round(random 4)) + 1; @@ -83,8 +85,9 @@ if (_vehicle != player) then { private[]; _tPos = (getPosASL _vehicle); _zPos = (getPosASL _unit); + _onSameFloor = ((abs((_tPos select 2) - (_tPos select 2)) < 1.3)); _inAngle = [_zPos,(getdir _unit),50,_tPos] call fnc_inAngleSector; - if (_inAngle) then { + if (_onSameFloor and _inAngle) then { //LOS check _cantSee = [_unit,_vehicle] call dayz_losCheck; if (!_cantSee) then { diff --git a/SQF/dayz_code/compile/zombie_findTarget.sqf b/SQF/dayz_code/compile/zombie_findTarget.sqf index 68bc7ccc9..4a5d89335 100644 --- a/SQF/dayz_code/compile/zombie_findTarget.sqf +++ b/SQF/dayz_code/compile/zombie_findTarget.sqf @@ -17,19 +17,19 @@ _targets = _lead nearTargets _range; private["_obj","_dis"]; _obj = _x select 4; _dis = _obj distance _lead; -// if (_obj isKindOf "Man") then { - if (((_obj isKindOf "Man") or (_obj isKindOf "AllVehicles")) and !(_obj isKindOf "zZombie_Base") and !(_obj in _targetMen)) then { + if (_obj isKindOf "Man") then { + if (!(_obj isKindOf "zZombie_Base") and !(_obj in _targetMen)) then { //process man targets _targetMen set [count _targetMen,_obj]; _targetDis set [count _targetDis,_dis]; }; -// } else { -// if ((_obj isKindOf "AllVehicles") and (count crew _obj > 0) and !(_obj in _targetMen)) then { -// //process vehicle targets -// _targetMen set [count _targetMen,_obj]; -// _targetDis set [count _targetDis,_dis]; -// }; -// }; + } else { + if ((speed _obj < 25) and (_obj isKindOf "AllVehicles") and ((count crew _obj) > 0) and !(_obj in _targetMen)) then { + //process vehicle targets + _targetMen set [count _targetMen,_obj]; + _targetDis set [count _targetDis,_dis]; + }; + }; } forEach _targets; //Search for fires