This commit is contained in:
johnb432 2024-02-02 23:59:10 +01:00
parent 43fb2613be
commit 2d8dc01f2c
3 changed files with 18 additions and 18 deletions

View File

@ -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 {

View File

@ -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

View File

@ -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));