Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frag - Remove setShotParents #10418

Merged
merged 7 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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