diff --git a/addons/dragging/functions/fnc_createClone.sqf b/addons/dragging/functions/fnc_createClone.sqf index 8194d9f5f1..da27e26997 100644 --- a/addons/dragging/functions/fnc_createClone.sqf +++ b/addons/dragging/functions/fnc_createClone.sqf @@ -39,6 +39,7 @@ if (!_isObjectHidden) then { [QEGVAR(common,hideObjectGlobal), [_target, true]] call CBA_fnc_serverEvent; }; +// Prevents unit from falling when below terrain private _simulationEnabled = simulationEnabled _target; if (_simulationEnabled) then { @@ -69,23 +70,22 @@ private _relevantHitpoints = ["HitHead", "HitBody", "HitHands", "HitLegs"]; _clone allowDamage false; _clone setVariable [QGVAR(original), [_target, _isInRemainsCollector, _isObjectHidden, _simulationEnabled], true]; +[_clone, _target call CBA_fnc_getLoadout] call CBA_fnc_setLoadout; + +// Sets the facial expression +[[QGVAR(cloneCreated), [_target, _clone]] call CBA_fnc_globalEventJIP, _clone] call CBA_fnc_removeGlobalEventJIP; + [{ - params ["_clone", "_target", "_posATL"]; + params ["_clone", "_target"]; // Remove clone from all zeuses if (["ace_zeus"] call EFUNC(common,isModLoaded)) then { [QEGVAR(zeus,removeObjects), [[_clone]]] call CBA_fnc_serverEvent; }; - // Clone loadout (sometimes default loadouts are randomised, so overwrite those) - [_clone, _target call CBA_fnc_getLoadout] call CBA_fnc_setLoadout; - - // Sets the facial expression - [[QGVAR(cloneCreated), [_target, _clone]] call CBA_fnc_globalEventJIP, _clone] call CBA_fnc_removeGlobalEventJIP; - // Release claim on corpse [objNull, _target] call EFUNC(common,claim); -}, [_clone, _target, _posATL], 0.25] call CBA_fnc_waitAndExecute; +}, [_clone, _target], 0.25] call CBA_fnc_waitAndExecute; // Save which curators had this object as editable if (["ace_zeus"] call EFUNC(common,isModLoaded)) then { diff --git a/addons/dragging/functions/fnc_startCarryLocal.sqf b/addons/dragging/functions/fnc_startCarryLocal.sqf index b4fb05c7a9..b30c2bf79e 100644 --- a/addons/dragging/functions/fnc_startCarryLocal.sqf +++ b/addons/dragging/functions/fnc_startCarryLocal.sqf @@ -34,15 +34,15 @@ if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { [LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); }; -// Create clone for dead units -if (!alive _target) then { - _target = [_unit, _target] call FUNC(createClone); -}; - private _timer = CBA_missionTime + 5; // Handle objects vs. persons if (_target isKindOf "CAManBase") then { + // Create clone for dead units + if (!alive _target) then { + _target = [_unit, _target] call FUNC(createClone); + }; + private _primaryWeapon = primaryWeapon _unit; // Add a primary weapon if the unit has none diff --git a/addons/dragging/functions/fnc_startDragLocal.sqf b/addons/dragging/functions/fnc_startDragLocal.sqf index e969fb0f79..0187e2ebb0 100644 --- a/addons/dragging/functions/fnc_startDragLocal.sqf +++ b/addons/dragging/functions/fnc_startDragLocal.sqf @@ -34,11 +34,6 @@ if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith { [LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); }; -// Create clone for dead units -if (!alive _target) then { - _target = [_unit, _target] call FUNC(createClone); -}; - private _primaryWeapon = primaryWeapon _unit; // Add a primary weapon if the unit has none @@ -89,6 +84,11 @@ if !(_unit call EFUNC(common,isSwimming)) then { // Move a bit closer and adjust direction when trying to pick up a person if (_target isKindOf "CAManBase") then { + // Create clone for dead units + if (!alive _target) then { + _target = [_unit, _target] call FUNC(createClone); + }; + [QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent; _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit vectorMultiply 1.5));