From 884bccf1cb614f5a31e3bd1d1a288b9e15763418 Mon Sep 17 00:00:00 2001 From: LinkIsGrim Date: Mon, 8 Jan 2024 04:40:28 -0300 Subject: [PATCH] add wound texture handling --- addons/dragging/functions/fnc_createClone.sqf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/dragging/functions/fnc_createClone.sqf b/addons/dragging/functions/fnc_createClone.sqf index 9457612b36..381b980376 100644 --- a/addons/dragging/functions/fnc_createClone.sqf +++ b/addons/dragging/functions/fnc_createClone.sqf @@ -40,6 +40,17 @@ if (_isInRemainsCollector) then { removeFromRemainsCollector [_target]; }; +// 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"]; +{ + private _hitpointDamage = _target getHitPointDamage _x; + _clone setHitPointDamage [_x, _hitpointDamage min 0.99]; +} forEach _relevantHitpoints; + // Disable all damage _clone allowDamage false; _clone setVariable [QGVAR(original), [_target, _isInRemainsCollector, _isObjectHidden], true];