Alternative way to address shot parent self-harm issue

This commit is contained in:
lambdatiger 2024-07-29 23:46:21 -05:00
parent 5059cb283d
commit ed36b6a4c8
2 changed files with 3 additions and 7 deletions

View File

@ -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;
}
];

View File

@ -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;
};
#ifdef DEBUG_MODE_DRAW
[_fragObj, "green", true] call FUNC(dev_trackObj);
[_targetPos, "(0.88,0.36,0.92,0.8)"] call FUNC(dev_sphereDraw);