diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index 8afa0f541a..f3a9329d35 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// drop if the crate is destroyed -if !([_target] call EFUNC(common,isAlive)) then { +// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) +if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject_carry); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index 2290c65e9d..8af8e62b90 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// drop if the crate is destroyed -if !([_target] call EFUNC(common,isAlive)) then { +// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) +if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index a932d4e189..d98522c5f2 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -16,8 +16,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// same as dragObjectPFH, checks if object is deleted or dead. -if !([_target] call EFUNC(common,isAlive)) then { +// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) +if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index 10d9d896a8..d77a23457e 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -16,8 +16,8 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// same as dragObjectPFH, checks if object is deleted or dead. -if !([_target] call EFUNC(common,isAlive)) then { +// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) +if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); [_this select 1] call CBA_fnc_removePerFrameHandler; };