From b32732cad0a8b1f2337b302e3af442dede0ffc64 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Tue, 23 Feb 2016 19:29:18 -0300 Subject: [PATCH] Delete the logic and group after used --- addons/explosives/XEH_postInit.sqf | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index 1b2b92767c..718aa1f99f 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -40,10 +40,10 @@ GVAR(CurrentSpeedDial) = 0; // placed mine. if (isServer) then { ["clientRequestsOrientation", { - params ["_logic"]; - TRACE_1("clientRequestsOrientations received:",_logic); + params ["_group"]; + TRACE_1("clientRequestsOrientations received:",_group); TRACE_2("serverSendsOrientations sent:",GVAR(explosivesOrientations)); - ["serverSendsOrientations", _logic, GVAR(explosivesOrientations)] call EFUNC(common,targetEvent); + ["serverSendsOrientations", _group, GVAR(explosivesOrientations)] call EFUNC(common,targetEvent); }] call EFUNC(common,addEventHandler); } else { ["serverSendsOrientations", { @@ -53,12 +53,17 @@ if (isServer) then { params ["_explosive","_direction","_pitch"]; [_explosive, _direction, _pitch] call FUNC(setPosition); } forEach _explosivesOrientations; + deleteGroup GVAR(localGroup); + GVAR(localGroup) = nil; + deleteVehicle GVAR(localLogic); + GVAR(localLogic) = nil; }] call EFUNC(common,addEventHandler); // Create a logic to get the client ID - private _logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"]; - TRACE_1("clientRequestsOrientations sent:",_logic); - ["clientRequestsOrientations", [_logic]] call EFUNC(common,serverEvent); + GVAR(localLogic) = sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"]; + GVAR(localGroup) = createGroup GVAR(localLogic); + TRACE_1("clientRequestsOrientations sent:",GVAR(localGroup)); + ["clientRequestsOrientations", [GVAR(localGroup)]] call EFUNC(common,serverEvent); }; ["interactMenuOpened", {