From fdbaeabc476f6676d814da9fd16eb2f6abbee98e Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 1 Apr 2024 16:33:08 +0200 Subject: [PATCH] Try syncing individually on each client --- addons/common/XEH_postInit.sqf | 5 ----- addons/dragging/XEH_postInit.sqf | 18 ++++++++++++++---- addons/dragging/functions/fnc_createClone.sqf | 10 ++-------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index e669243ee3..1f259c2e3d 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -122,11 +122,6 @@ _object setMass _mass; }] call CBA_fnc_addEventHandler; -[QGVAR(awake), { - params ["_object", "_awake"]; - _object awake _awake; -}] call CBA_fnc_addEventHandler; - [QGVAR(disableWeaponAssembly), { params ["_object", "_set"]; _object enableWeaponDisassembly (_set < 1); diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index 14a1c1e363..1aef704226 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -67,6 +67,18 @@ if (isNil QGVAR(maxWeightCarryRun)) then { _clone setMimic "unconscious"; }] call CBA_fnc_addEventHandler; +[QGVAR(syncCorpse),{ + params ["_corpse"]; + + [{ + _this awake true; + + [{ + _this awake false; + }, _this] call CBA_fnc_execNextFrame; + }, _corpse] call CBA_fnc_execNextFrame; +}] call CBA_fnc_addEventHandler; + [QGVAR(moveCorpse), { params ["_corpse", "_dir", "_pos"]; @@ -76,10 +88,8 @@ if (isNil QGVAR(maxWeightCarryRun)) then { // Bring corpse back to clone's position _corpse setPosATL _pos; - // Sync the corpse - [QEGVAR(common,awake), [_corpse, true]] call CBA_fnc_globalEvent; - [QEGVAR(common,awake), [_corpse, false]] call CBA_fnc_globalEvent; - [QEGVAR(common,awake), [_corpse, true]] call CBA_fnc_globalEvent; + // Sync the corpse with its position + [QGVAR(syncCorpse), _corpse] call CBA_fnc_globalEvent; }] call CBA_fnc_addEventHandler; // Display event handler diff --git a/addons/dragging/functions/fnc_createClone.sqf b/addons/dragging/functions/fnc_createClone.sqf index da27e26997..e80724682b 100644 --- a/addons/dragging/functions/fnc_createClone.sqf +++ b/addons/dragging/functions/fnc_createClone.sqf @@ -54,17 +54,11 @@ if (_isInRemainsCollector) then { }; // Make sure clone has the same wound textures as the corpse -private _targetDamage = damage _target; - -if (_targetDamage != 0) then { - _clone setDamage (_targetDamage min 0.99); // don't kill the clone -}; - -private _relevantHitpoints = ["HitHead", "HitBody", "HitHands", "HitLegs"]; +_clone setDamage ((damage _target) min 0.99); // don't kill the clone { _clone setHitPointDamage [_x, (_target getHitPointDamage _x) min 0.99]; -} forEach _relevantHitpoints; +} forEach ["HitHead", "HitBody", "HitHands", "HitLegs"]; // relevant hitpoints // Disable all damage _clone allowDamage false;