From f0f513286795862dcc3671cd10724714acec2d0a Mon Sep 17 00:00:00 2001 From: eraser1 Date: Fri, 28 Aug 2015 00:27:02 -0500 Subject: [PATCH] Cleanup Logic Change Don't use isPlayerNearbyArray, so each object gets its own check (so that all objects don't get skipped just because a player is near one object) --- .../addons/a3_dms/scripts/CleanUp.sqf | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/@ExileServer/addons/a3_dms/scripts/CleanUp.sqf b/@ExileServer/addons/a3_dms/scripts/CleanUp.sqf index e53e70a..e537a1c 100644 --- a/@ExileServer/addons/a3_dms/scripts/CleanUp.sqf +++ b/@ExileServer/addons/a3_dms/scripts/CleanUp.sqf @@ -6,22 +6,26 @@ if !((typeName _this) isEqualTo "ARRAY") then { _this = [_this]; }; -if ([_this,20] call DMS_isPlayerNearbyARRAY) exitWith //<---TODO: Improve/Replace? +/* +if ([_this,20] call DMS_isPlayerNearbyARRAY) exitWith //<-----Not sure if it's more/less efficient { [30, DMS_CleanUp, _this, false] call ExileServer_system_thread_addTask; }; +*/ { - _x enableSimulationGlobal false; - _x removeAllMPEventHandlers "mpkilled"; - _x removeAllMPEventHandlers "mphit"; - _x removeAllMPEventHandlers "mprespawn"; - _x removeAllEventHandlers "FiredNear"; - _x removeAllEventHandlers "HandleDamage"; - _x removeAllEventHandlers "Killed"; - _x removeAllEventHandlers "Fired"; - _x removeAllEventHandlers "GetOut"; - _x removeAllEventHandlers "GetIn"; - _x removeAllEventHandlers "Local"; - deleteVehicle _x; + if !([_this,20] call ExileServer_util_position_isPlayerNearby) then { + _x enableSimulationGlobal false; + _x removeAllMPEventHandlers "mpkilled"; + _x removeAllMPEventHandlers "mphit"; + _x removeAllMPEventHandlers "mprespawn"; + _x removeAllEventHandlers "FiredNear"; + _x removeAllEventHandlers "HandleDamage"; + _x removeAllEventHandlers "Killed"; + _x removeAllEventHandlers "Fired"; + _x removeAllEventHandlers "GetOut"; + _x removeAllEventHandlers "GetIn"; + _x removeAllEventHandlers "Local"; + deleteVehicle _x; + }; false; } count _this; \ No newline at end of file