clarified parts of the spall event chain

This commit is contained in:
lambdatiger 2024-07-19 00:01:55 -05:00
parent c344130f9b
commit f57f6f5a06
2 changed files with 3 additions and 4 deletions

View File

@ -120,6 +120,6 @@ for "_i" from 1 to _spallCount do {
_fragment setShotParents _shotParents;
#ifdef DEBUG_MODE_DRAW
[_fragment, "orange", true] call FUNC(dev_trackObj);
[_fragment, "purple", true] call FUNC(dev_trackObj);
#endif
};

View File

@ -27,14 +27,13 @@ if (GVAR(spallEnabled) && {_ammo call FUNC(shouldSpall)}) then {
private _hitPartEventHandler = _projectile addEventHandler [
"HitPart",
{
params ["_projectile", "_hitObject", "", "_posASL", "_velocity", "_surfNorm", "", "", "_surfType"];
params ["_projectile", "_hitObject", "", "_posASL", "_velocity"];
// starting v2.18 it may be faster to use the instigator parameter, the same as the second entry shotParents, to recreate _shotParent
// starting v2.18 it may be faster to use the instigator EH parameter, the same as the second entry shotParents, to recreate _shotParent
// The "explode" EH does not get the same parameter
private _shotParents = getShotParents _projectile;
private _ammo = typeOf _projectile;
/*
* Wait a frame to see what happens to the round, may result in
* multiple hits / slowdowns getting shunted to the first hit