From 81a37c93f7a7b550ea3011f8e3e4941aaba5f1bc Mon Sep 17 00:00:00 2001 From: nomisum Date: Sun, 2 Jun 2019 12:10:00 +0200 Subject: [PATCH] detaching of terminal refinements again --- BC_setup/functions/client/fn_addInteractions.sqf | 13 ++----------- grad_tracking/cfgFunctions.hpp | 1 + .../functions/player/fn_terminalDetach.sqf | 12 ++++++++++++ 3 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 grad_tracking/functions/player/fn_terminalDetach.sqf diff --git a/BC_setup/functions/client/fn_addInteractions.sqf b/BC_setup/functions/client/fn_addInteractions.sqf index 9d99d456..addbf177 100644 --- a/BC_setup/functions/client/fn_addInteractions.sqf +++ b/BC_setup/functions/client/fn_addInteractions.sqf @@ -183,18 +183,9 @@ if (!hasInterface) exitWith {}; { [4, [_this select 0], { ((_this select 0) select 0) setVariable ["detachableRadio", 2, true]; - - _terminal = missionNamespace getVariable ["GRAD_tracking_terminalObj", objNull]; - _radioVeh = missionNamespace getVariable ["GRAD_tracking_radioVehObj", objNull]; - - detach _terminal; - - // safely put down - _terminal setVehiclePosition [_radioVeh getRelPos [2, 180], [], 6, "NONE"]; + private _radioVeh = missionNamespace getVariable ["GRAD_tracking_radioVehObj", objNull]; + [] remoteExec ["GRAD_tracking_fnc_terminalDetach", _radioVeh]; - GRAD_TERMINAL = true; publicVariable "GRAD_TERMINAL"; - - [_terminal, true, [0,1.4,0], 270] remoteExec ["ace_dragging_fnc_setDraggable", 0, true]; }, {hint "Cancelled action"}, (localize "str_GRAD_detaching_radio")] call ace_common_fnc_progressBar; }, {(side player == east) && ((_this select 0) getVariable ["detachableRadio", 0] == 1)}] call ace_interact_menu_fnc_createAction; diff --git a/grad_tracking/cfgFunctions.hpp b/grad_tracking/cfgFunctions.hpp index 6ace4078..cb2f539a 100644 --- a/grad_tracking/cfgFunctions.hpp +++ b/grad_tracking/cfgFunctions.hpp @@ -52,5 +52,6 @@ class GRAD_tracking { class terminalDistanceListenerServer {}; class terminalDistanceToVehCalc {}; class terminalIsSending {}; + class terminalDetach; }; }; \ No newline at end of file diff --git a/grad_tracking/functions/player/fn_terminalDetach.sqf b/grad_tracking/functions/player/fn_terminalDetach.sqf new file mode 100644 index 00000000..7eacfa9f --- /dev/null +++ b/grad_tracking/functions/player/fn_terminalDetach.sqf @@ -0,0 +1,12 @@ +private _terminal = missionNamespace getVariable ["GRAD_tracking_terminalObj", objNull]; +private _radioVeh = missionNamespace getVariable ["GRAD_tracking_radioVehObj", objNull]; + + +detach _terminal; +// safely put down +_terminal setVehiclePosition [_radioVeh getRelPos [3, 180], [], 3, "NONE"]; + + +GRAD_TERMINAL = true; publicVariable "GRAD_TERMINAL"; + +[_terminal, true, [0,1.4,0], 270] remoteExec ["ace_dragging_fnc_setDraggable", 0, true]; \ No newline at end of file