use ownerEvent instead of game logics

This commit is contained in:
commy2 2017-12-11 20:11:21 +01:00
parent d234fd33a0
commit 4319b79b45
4 changed files with 10 additions and 19 deletions

View File

@ -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", {

View File

@ -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) = [];

View File

@ -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;

View File

@ -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;