From 4319b79b45ebe9aec21b3120aba1d265a84c2d0a Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 11 Dec 2017 20:11:21 +0100 Subject: [PATCH] use ownerEvent instead of game logics --- addons/explosives/XEH_postInit.sqf | 13 +++++-------- addons/markers/XEH_postInit.sqf | 3 +-- addons/markers/functions/fnc_sendMarkersJIP.sqf | 8 ++++---- addons/markers/functions/fnc_setMarkerJIP.sqf | 5 ----- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index 7cc99bf921..706a11d629 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -43,15 +43,15 @@ if (isServer) then { }] call CBA_fnc_addEventHandler; [QGVAR(sendOrientations), { - params ["_logic"]; - TRACE_1("sendOrientations received:",_logic); + params ["_owner"]; + TRACE_1("sendOrientations received:",_owner); // Filter the array before sending it GVAR(explosivesOrientations) = GVAR(explosivesOrientations) select { _x params ["_explosive"]; (!isNull _explosive && {alive _explosive}) }; TRACE_1("orientationsSent sent:",GVAR(explosivesOrientations)); - [QGVAR(orientationsSent), [GVAR(explosivesOrientations)], _logic] call CBA_fnc_targetEvent; + [QGVAR(orientationsSent), [GVAR(explosivesOrientations)], _owner] call CBA_fnc_ownerEvent; }] call CBA_fnc_addEventHandler; }; @@ -73,14 +73,11 @@ if (didJIP) then { TRACE_3("orientation set:",_explosive,_direction,_pitch); [_explosive, _direction, _pitch] call FUNC(setPosition); } forEach _explosivesOrientations; - deleteVehicle GVAR(localLogic); - GVAR(localLogic) = nil; }] call CBA_fnc_addEventHandler; // Create a logic to get the client ID - GVAR(localLogic) = ([sideLogic] call CBA_fnc_getSharedGroup) createUnit ["Logic", [0,0,0], [], 0, "NONE"]; - TRACE_1("sendOrientations sent:",GVAR(localLogic)); - [QGVAR(sendOrientations), [GVAR(localLogic)]] call CBA_fnc_serverEvent; + TRACE_1("sendOrientations sent:",CBA_clientID); + [QGVAR(sendOrientations), CBA_clientID] call CBA_fnc_serverEvent; }; ["ace_interactMenuOpened", { diff --git a/addons/markers/XEH_postInit.sqf b/addons/markers/XEH_postInit.sqf index eadf5be907..900b17ecf7 100644 --- a/addons/markers/XEH_postInit.sqf +++ b/addons/markers/XEH_postInit.sqf @@ -9,8 +9,7 @@ // request marker data for JIP if (isMultiplayer && {!isServer} && {hasInterface}) then { - GVAR(localLogic) = (createGroup sideLogic) createUnit ["Logic", [0,0,0], [], 0, "NONE"]; - [QGVAR(sendMarkersJIP), [GVAR(localLogic)]] call CBA_fnc_serverEvent; + [QGVAR(sendMarkersJIP), CBA_clientID] call CBA_fnc_serverEvent; }; GVAR(mapDisplaysWithDrawEHs) = []; diff --git a/addons/markers/functions/fnc_sendMarkersJIP.sqf b/addons/markers/functions/fnc_sendMarkersJIP.sqf index e63a32b843..1eee39560c 100644 --- a/addons/markers/functions/fnc_sendMarkersJIP.sqf +++ b/addons/markers/functions/fnc_sendMarkersJIP.sqf @@ -15,11 +15,11 @@ */ #include "script_component.hpp" -params ["_logic"]; -TRACE_1("params",_logic); +params ["_owner"]; +TRACE_1("params",_owner); [ QGVAR(setMarkerJIP), [GETGVAR(allMapMarkers,[]), GETGVAR(allMapMarkersProperties,[])], - [_logic] -] call CBA_fnc_targetEvent; + _owner +] call CBA_fnc_ownerEvent; diff --git a/addons/markers/functions/fnc_setMarkerJIP.sqf b/addons/markers/functions/fnc_setMarkerJIP.sqf index ccac7d2b7b..1acd758556 100644 --- a/addons/markers/functions/fnc_setMarkerJIP.sqf +++ b/addons/markers/functions/fnc_setMarkerJIP.sqf @@ -50,8 +50,3 @@ TRACE_3("params",_allMapMarkers,_allMapMarkersProperties); }; false } count allMapMarkers; - -private _group = group GVAR(localLogic); -deleteVehicle GVAR(localLogic); -GVAR(localLogic) = nil; -deleteGroup _group;