Merge pull request #123 from Ignatz-HeMan/patch-1

Skip cleanup if players near
This commit is contained in:
Ghostrider [GRG] 2018-11-27 08:19:40 -05:00 committed by GitHub
commit cd08b3002c
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};
if (_nearplayer isequalto []) then {
{ {
deleteVehicle _x; deleteVehicle _x;
}forEach nearestObjects [getPos _ai,["WeaponHolderSimulated","GroundWeapoonHolder"],3]; }forEach nearestObjects [getPos _ai,["WeaponHolderSimulated","GroundWeapoonHolder"],3];
blck_deadAI = blck_deadAI - [_ai]; blck_deadAI = blck_deadAI - [_ai];
deleteVehicle _ai; deleteVehicle _ai;
}; };
};
} forEach _aiList; } forEach _aiList;