Skip to content

Commit

Permalink
Frag - Remove setShotParents (#10418)
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdatiger authored Oct 13, 2024
1 parent d2b60a5 commit 1496ddf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions addons/frag/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
};
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);

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
[{
[QGVAR(frag_eh), _this] call CBA_fnc_serverEvent
}, [_posASL, _ammo, [objNull, _instigator]]] call CBA_fnc_execNextFrame;
}, [_posASL, _ammo]] call CBA_fnc_execNextFrame;
};
}] call EFUNC(common,addExplosionEventHandler);

Expand Down
7 changes: 2 additions & 5 deletions addons/frag/functions/fnc_frago.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Arguments:
* 0: ASL position projetile is fragmenting at <ARRAY>
* 1: Projectile ammo classname <STRING>
* 2: Projectile shot parents <ARRAY>
*
* Return Value:
* The number of fragments created <NUMBER>
Expand All @@ -21,8 +20,8 @@

BEGIN_COUNTER(frago);

params ["_fragPosASL", "_shellType", "_shotParents"];
TRACE_3("frago",_fragPosASL,_shellType,_shotParents);
params ["_fragPosASL", "_shellType"];
TRACE_2("frago",_fragPosASL,_shellType);

// Limit max frag count if there was a recent frag
private _maxFrags = round linearConversion [
Expand Down Expand Up @@ -114,7 +113,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 {
Expand Down Expand Up @@ -147,7 +145,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);
Expand Down

0 comments on commit 1496ddf

Please sign in to comment.