From 59bf6e3b9112698d51d4f56e5efaf0b206769361 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Wed, 17 Jan 2024 23:13:31 -0600 Subject: [PATCH] Shot parent possible fix #1 --- addons/frag/XEH_postInit.sqf | 6 ++++++ addons/frag/functions/fnc_initRound.sqf | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index 6209f17e0e..5e2ac8aac0 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -6,6 +6,12 @@ if (isServer) then { call FUNC(initBlackList); call FUNC(initMaterialCache); + [ + QEGVAR(common,setShotParents), + { + (_this#0) setVariable [QGVAR(shotParent), [_this#1, _this#2]]; + } + ] call CBA_fnc_addEventHandler; }; #ifdef DEBUG_MODE_DRAW diff --git a/addons/frag/functions/fnc_initRound.sqf b/addons/frag/functions/fnc_initRound.sqf index 51c4920533..b37333cd64 100644 --- a/addons/frag/functions/fnc_initRound.sqf +++ b/addons/frag/functions/fnc_initRound.sqf @@ -31,7 +31,7 @@ if (GVAR(enabled) && {_ammo call FUNC(shouldFrag)}) then { "Explode", { params ["_projectile", "_posASL", "_velocity"]; - private _shotParents = getShotParents _projectile; + private _shotParents = _projectile getVariable [QGVAR(shotParent), getShotParents _projectile]; private _ammo = typeOf _projectile; // wait for frag damage to kill units before spawning fragments [