From ed36b6a4c81515ee40e0622f922ff12a1479d743 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Mon, 29 Jul 2024 23:46:21 -0500 Subject: [PATCH] Alternative way to address shot parent self-harm issue --- addons/frag/functions/fnc_fired.sqf | 4 ++-- addons/frag/functions/fnc_frago.sqf | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index 2a6ca32cc2..f0a04422b4 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -45,7 +45,7 @@ if (GVAR(spallEnabled) && {_ammo call FUNC(shouldSpall)}) then { if (CBA_missionTime < _shotParents#1 getVariable [QGVAR(nextSpallEvent), -1]) exitWith {}; _this call FUNC(doSpall); }, - [_hitObject, _ammo, _projectile, _posASL, _velocity, _shotParents] + [_hitObject, _ammo, _projectile, _posASL, _velocity, [objNull, _shotParents#1]] ] call CBA_fnc_execNextFrame; } ]; @@ -73,7 +73,7 @@ if (GVAR(reflectionsEnabled) || GVAR(enabled) && _ammo call FUNC(shouldFrag)) th // Wait a frame to make sure it doesn't target the dead [ { [QGVAR(frag_eh), _this] call CBA_fnc_serverEvent; }, - [_posASL, _ammo, _shotParents] + [_posASL, _ammo, [objNull _instigator]] ] call CBA_fnc_execNextFrame; } ]; diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index d4bbf44a8b..722fd47997 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -113,11 +113,7 @@ if (_targets isNotEqualTo []) then { private _fragObj = createVehicleLocal [selectRandom _fragTypes, _fragPosAGL, [], 0, "CAN_COLLIDE"]; _fragObj setVectorDir _vectorDir; _fragObj setVelocity _fragObjVelocity; - if (_shotParents#0 isEqualTo _target) then { - _fragObj setShotParents [objNull, _fragObj#1]; - } else { - _fragObj setShotParents _shotParents; - }; + _fragObj setShotParents _shotParents; #ifdef DEBUG_MODE_DRAW [_fragObj, "green", true] call FUNC(dev_trackObj); [_targetPos, "(0.88,0.36,0.92,0.8)"] call FUNC(dev_sphereDraw);