fix: timeout could cause being stuck with attached item

This commit is contained in:
commy2 2015-03-22 17:35:26 +01:00
parent 11bb1a050a
commit 84dbeb19d1

View File

@ -11,6 +11,14 @@ _timeOut = _this select 0 select 2;
if (time > _timeOut) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
// drop if in timeout
private "_draggedObject";
_draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
if (!isNull _draggedObject) exitWith {
[_unit, _draggedObject] call FUNC(dropObject);
};
// re-enable everything
_unit setVariable [QGVAR(isDragging), false, true];
};