diff --git a/SQF/dayz_code/compile/player_zombieAttack.sqf b/SQF/dayz_code/compile/player_zombieAttack.sqf index e1485ecff..6c040f096 100644 --- a/SQF/dayz_code/compile/player_zombieAttack.sqf +++ b/SQF/dayz_code/compile/player_zombieAttack.sqf @@ -20,6 +20,7 @@ _playerDodged = false; if (_type != "zombie") exitWith { diag_log ("not a zombie"); }; // we deal only with zombies in this function if (_unit distance _vehicle > 3) exitWith {}; // distance too far according to any logic dealt here //+str(_unit distance _nextPlayerPos)+"/"+str(_areaAffect) +if (isNull _unit) exitWith {}; // Prevent errors if zombie is deleted suddenly // compute the animation move _rnd = 0; @@ -85,7 +86,7 @@ if (local _unit) then { */ [objNull, _unit, rplaymove, _move] call RE; uiSleep 0.5; - +if (isNull _unit) exitWith {}; // Prevent errors if zombie is deleted suddenly //slow it down make sure the animation isnt running after the damage //_timeout = diag_tickTime + 0.3; //waitUntil { diag_tickTime >= _timeout; }; diff --git a/SQF/dayz_code/compile/zombie_findTargetAgent.sqf b/SQF/dayz_code/compile/zombie_findTargetAgent.sqf index 4fe769b8a..1a13dea4d 100644 --- a/SQF/dayz_code/compile/zombie_findTargetAgent.sqf +++ b/SQF/dayz_code/compile/zombie_findTargetAgent.sqf @@ -1,5 +1,6 @@ private ["_target","_targets","_man","_manDis","_localtargets","_remotetargets"]; _agent = _this; +if (isNull _agent) exitWith {objNull}; // Prevent errors if zombie is suddenly deleted _target = objNull; _targets = []; //_targetDis = []; diff --git a/SQF/dayz_code/system/zombie_agent.fsm b/SQF/dayz_code/system/zombie_agent.fsm index 82c66a7ff..01756309f 100644 --- a/SQF/dayz_code/system/zombie_agent.fsm +++ b/SQF/dayz_code/system/zombie_agent.fsm @@ -760,6 +760,7 @@ class FSM "_remotetargets = _agent getVariable [""remotetargets"",[]];" \n "" \n "//Clear remote on reset" \n + "if (isNull _agent) then {_remotetargets = [];};" \n "if (count _remotetargets > 0) then {" \n " _agent setVariable [""remotetargets"",[],true];" \n "};" \n