diff --git a/SQF/dayz_code/Configs/CfgVehicles/Animal.hpp b/SQF/dayz_code/Configs/CfgVehicles/Animal.hpp index f9dd11273..73518c7b3 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Animal.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Animal.hpp @@ -3,8 +3,7 @@ class CAAnimalBase: Animal { class Eventhandlers { - //local = "_z = _this select 0; if ((!isServer and !isNull _z) and {(side _z != civilian)}) exitWith { PVDZ_sec_atp = [ 'wrong side', player ]; publicVariableServer 'PVDZ_sec_atp'; deleteVehicle _z; }; if ((_this select 1) and isServer) exitWith { _z call sched_co_deleteVehicle; };"; - local = "_z = _this select 0; if ((_this select 1) and isServer) exitWith { _z call sched_co_deleteVehicle; };"; + //local = "_z = _this select 0; if ((!isServer and !isNull _z) and {(side _z != civilian)}) exitWith { PVDZ_sec_atp = [ 'wrong side', player ]; publicVariableServer 'PVDZ_sec_atp'; deleteVehicle _z; };"; }; class UserActions { diff --git a/SQF/dayz_server/system/scheduler/sched_corpses.sqf b/SQF/dayz_server/system/scheduler/sched_corpses.sqf index aaab12e30..f2e541ba9 100644 --- a/SQF/dayz_server/system/scheduler/sched_corpses.sqf +++ b/SQF/dayz_server/system/scheduler/sched_corpses.sqf @@ -26,7 +26,7 @@ sched_co_deleteVehicle = { sched_corpses = { - private ["_delQtyZ","_delQtyP","_addFlies","_x","_deathTime","_onoff","_delQtyAnimal", "_sound", "_deathPos", "_cpos"]; + private ["_delQtyZ","_delQtyP","_addFlies","_x","_deathTime","_onoff","_delQtyAnimal","_sound","_deathPos","_cpos","_animal","_nearPlayer"]; // EVERY 2 MINUTE // DELETE UNCONTROLLED ZOMBIES --- PUT FLIES ON FRESH PLAYER CORPSES --- REMOVE OLD FLIES & CORPSES _delQtyZ = 0; @@ -105,9 +105,13 @@ sched_corpses = { _delQtyAnimal = 0; { - if (local _x) then { - _x call sched_co_deleteVehicle; - _delQtyAnimal = _delQtyAnimal + 1; + _animal = _x; + if (local _animal) then { + _nearPlayer = {isPlayer _x} count (_animal nearEntities ["CAManBase",150]); + if (_nearPlayer == 0) then { + _animal call sched_co_deleteVehicle; + _delQtyAnimal = _delQtyAnimal + 1; + }; }; } forEach entities "CAAnimalBase";