Skip cleanup if players near

This commit is contained in:
He-Man 2018-11-21 18:55:02 +01:00 committed by GitHub
parent 371d462bb3
commit 03e68a7f3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,11 +21,14 @@ _aiList = +blck_deadAI;
if ( diag_tickTime > _x getVariable ["blck_cleanupAt",0] ) then // DBD_DeleteAITimer if ( diag_tickTime > _x getVariable ["blck_cleanupAt",0] ) then // DBD_DeleteAITimer
{ {
_ai = _x; _ai = _x;
{ _nearplayer = (_ai nearEntities 1500) select {isplayer _x};
deleteVehicle _x; if (_nearplayer isequalto []) then {
}forEach nearestObjects [getPos _ai,["WeaponHolderSimulated","GroundWeapoonHolder"],3]; {
blck_deadAI = blck_deadAI - [_ai]; deleteVehicle _x;
deleteVehicle _ai; }forEach nearestObjects [getPos _ai,["WeaponHolderSimulated","GroundWeapoonHolder"],3];
blck_deadAI = blck_deadAI - [_ai];
deleteVehicle _ai;
};
}; };
} forEach _aiList; } forEach _aiList;