From cf8a7f742e9fb5ed71168e059587676f8097b1d7 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 21 Sep 2015 22:50:48 -0500 Subject: [PATCH] #2541 - Attach getIn/Out run on local unit --- addons/attach/functions/fnc_handleGetIn.sqf | 11 ++++++++--- addons/attach/functions/fnc_handleGetOut.sqf | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/attach/functions/fnc_handleGetIn.sqf b/addons/attach/functions/fnc_handleGetIn.sqf index b7b2997081..d9f469eee2 100644 --- a/addons/attach/functions/fnc_handleGetIn.sqf +++ b/addons/attach/functions/fnc_handleGetIn.sqf @@ -17,11 +17,11 @@ */ #include "script_component.hpp" -if (!isServer) exitWith {}; - params ["", "", "_unit"]; TRACE_1("params",_unit); +if (!local _unit) exitWith {}; + private ["_attachedList"]; _attachedList = _unit getVariable [QGVAR(attached), []]; @@ -29,9 +29,14 @@ if ((count _attachedList) == 0) exitWith {}; (_attachedList select 0) params ["_xObject"]; if (!isNull _xObject) then { + TRACE_1("detaching and moving attached light",_xObject); detach _xObject; _xObject setPos ((getPos _unit) vectorAdd [0, 0, -1000]); - [{deleteVehicle (_this select 0)}, [_xObject], 2] call EFUNC(common,waitAndExecute); + [{ + params ["_detachedLight"]; + TRACE_1("delayed delete",_detachedLight); + deleteVehicle _detachedLight; + }, [_xObject], 2] call EFUNC(common,waitAndExecute); (_attachedList select 0) set [0, objNull]; }; diff --git a/addons/attach/functions/fnc_handleGetOut.sqf b/addons/attach/functions/fnc_handleGetOut.sqf index 57fb69cf15..4ed268d5dc 100644 --- a/addons/attach/functions/fnc_handleGetOut.sqf +++ b/addons/attach/functions/fnc_handleGetOut.sqf @@ -17,11 +17,11 @@ */ #include "script_component.hpp" -if (!isServer) exitWith {}; - params ["", "", "_unit"]; TRACE_1("params",_unit); +if (!local _unit) exitWith {}; + private ["_attachedList"]; _attachedList = _unit getVariable [QGVAR(attached), []];