From 12e226bf46ab2c77ff763de8afe9c4a19be7e127 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Sun, 13 Oct 2024 15:58:42 -0500 Subject: [PATCH 1/6] Removed shot parents references --- addons/frag/XEH_postInit.sqf | 5 +---- addons/frag/functions/fnc_frago.sqf | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index 7b0e32e04c9..cf2cd314fce 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -12,15 +12,12 @@ }; if (GVAR(enabled) && _ammo call FUNC(shouldFrag)) then { // only let a unit make a frag event once per second - private _shotParents = getShotParents _projectile; - private _instigator = _shotParents select !isNull (_shotParents#1); if (CBA_missionTime < (_instigator getVariable [QGVAR(nextFragEvent), -1])) exitWith {}; - _instigator setVariable [QGVAR(nextFragEvent), CBA_missionTime + ACE_FRAG_FRAG_UNIT_HOLDOFF]; // Wait a frame to make sure it doesn't target the dead [{ [QGVAR(frag_eh), _this] call CBA_fnc_serverEvent - }, [_posASL, _ammo, [objNull, _instigator]]] call CBA_fnc_execNextFrame; + }, _this] call CBA_fnc_execNextFrame; }; }] call EFUNC(common,addExplosionEventHandler); diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index bda1aa58f6d..eb548bcce85 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -21,7 +21,7 @@ BEGIN_COUNTER(frago); -params ["_fragPosASL", "_shellType", "_shotParents"]; +params ["_shellType", "_fragPosASL"]; TRACE_3("frago",_fragPosASL,_shellType,_shotParents); // Limit max frag count if there was a recent frag @@ -114,7 +114,6 @@ if (_targets isNotEqualTo []) then { private _fragObj = createVehicleLocal [selectRandom _fragTypes, _fragPosAGL, [], 0, "CAN_COLLIDE"]; _fragObj setVectorDir _vectorDir; _fragObj setVelocity _fragObjVelocity; - _fragObj setShotParents _shotParents; #ifdef DEBUG_MODE_DRAW [_fragObj, "green", true] call FUNC(dev_trackObj); if (GVAR(dbgSphere)) then { From 58efcc96f50a9a32d4fec17be1421344a7d308e9 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Sun, 13 Oct 2024 16:02:13 -0500 Subject: [PATCH 2/6] Removed last reference to shotParents --- addons/frag/functions/fnc_frago.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index eb548bcce85..4ba0f252e0f 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -22,7 +22,7 @@ BEGIN_COUNTER(frago); params ["_shellType", "_fragPosASL"]; -TRACE_3("frago",_fragPosASL,_shellType,_shotParents); +TRACE_2("frago",_fragPosASL,_shellType); // Limit max frag count if there was a recent frag private _maxFrags = round linearConversion [ From 9ea4f1aa2e96d01e0f453ca90cfbafc32c98380a Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Sun, 13 Oct 2024 16:03:01 -0500 Subject: [PATCH 3/6] removed shot parents final_final --- addons/frag/functions/fnc_frago.sqf | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index 4ba0f252e0f..563c6f20531 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -146,7 +146,6 @@ if (_targets isNotEqualTo []) then { private _fragObj = createVehicleLocal [selectRandom _fragTypes, _fragPosAGL, [], 0, "CAN_COLLIDE"]; _fragObj setVectorDir _vectorDir; _fragObj setVelocity _fragObjVelocity; - _fragObj setShotParents _shotParents; #ifdef DEBUG_MODE_DRAW [_fragObj, "blue", true] call FUNC(dev_trackObj); From ccad045df150133b92b07872b62d53ec8e7705f7 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Sun, 13 Oct 2024 16:09:46 -0500 Subject: [PATCH 4/6] fixed frago params --- addons/frag/functions/fnc_frago.sqf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index 563c6f20531..e0e35f18a88 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -4,9 +4,8 @@ * Server func to create the fragmentation for a round. * * Arguments: - * 0: ASL position projetile is fragmenting at - * 1: Projectile ammo classname - * 2: Projectile shot parents + * 0: Projectile ammo classname + * 1: ASL position projetile is fragmenting at * * Return Value: * The number of fragments created From 05a742b721567df84037379ee2f31fc860d493be Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Sun, 13 Oct 2024 16:10:08 -0500 Subject: [PATCH 5/6] fixed removed instigator param --- addons/frag/XEH_postInit.sqf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index cf2cd314fce..d441256de81 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -12,7 +12,10 @@ }; if (GVAR(enabled) && _ammo call FUNC(shouldFrag)) then { // only let a unit make a frag event once per second + + private _instigator = _shotParents select !isNull ((getShotParents _projectile)#1); if (CBA_missionTime < (_instigator getVariable [QGVAR(nextFragEvent), -1])) exitWith {}; + _instigator setVariable [QGVAR(nextFragEvent), CBA_missionTime + ACE_FRAG_FRAG_UNIT_HOLDOFF]; // Wait a frame to make sure it doesn't target the dead [{ From 97cd311c2573b4a19064678f6126a79a2e62f2b5 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Sun, 13 Oct 2024 16:13:41 -0500 Subject: [PATCH 6/6] Fixed - missing params - could've been a bit smarter about this --- addons/frag/XEH_postInit.sqf | 2 +- addons/frag/functions/fnc_frago.sqf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index d441256de81..b4c307749b8 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -20,7 +20,7 @@ // Wait a frame to make sure it doesn't target the dead [{ [QGVAR(frag_eh), _this] call CBA_fnc_serverEvent - }, _this] call CBA_fnc_execNextFrame; + }, [_posASL, _ammo]] call CBA_fnc_execNextFrame; }; }] call EFUNC(common,addExplosionEventHandler); diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index e0e35f18a88..b6d20883d2d 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -4,8 +4,8 @@ * Server func to create the fragmentation for a round. * * Arguments: - * 0: Projectile ammo classname - * 1: ASL position projetile is fragmenting at + * 0: ASL position projetile is fragmenting at + * 1: Projectile ammo classname * * Return Value: * The number of fragments created @@ -20,7 +20,7 @@ BEGIN_COUNTER(frago); -params ["_shellType", "_fragPosASL"]; +params ["_fragPosASL", "_shellType"]; TRACE_2("frago",_fragPosASL,_shellType); // Limit max frag count if there was a recent frag