Impact Callback Context caching causing issues with delayed impact actions

Hi, I have a delayed damage action for a grenade explosion, but the damage is only applied to one target.

It seems that the last object processed in the hit objects loop in the Explode() method caches, and is pulled as the context for all the impact actions for the explosion.

To clarify,
Lets say an explosion hits three characters, with a damage action with a delay of 1 second.
The following code runs for characters A, B, and C.
(lines 221 to 233 Explosion.cs)
C#:
                var impactData = GetImpactData();
                {
                    impactData.SetImpactSource(this);
                    impactData.SetImpactTarget(hitCollider);
                    impactData.ImpactPosition = closestPoint;
                    impactData.ImpactDirection = hitDirection;
                    impactData.ImpactStrength = damageModifier;
                }

                var impactCallback = m_CachedImpactCallbackContext;
                impactCallback.ImpactCollisionData = impactData;
                impactCallback.ImpactDamageData = m_ImpactDamageData;
                m_ImpactActionGroup.OnImpact(impactCallback, true);

A second later, three impact actions trigger, but the context for all of them only have the data from Object C, causing Object C to take damage 3 times.
This does not happen with 0 delay, and works as expected.

I'm not sure if this is user error or a bug.
Can someone confirm if I am misusing the item action delay, or if this is unexpected functionality?
 
Thank you for bringing this to my attention.
I fixed the issue by duplicating the impact callback context when the impact action is scheduled. It duplicates inside a pooled context which sould keep things performant. I also made sure the scheduled actions are stored in a list such that multiple scheduled action can be tracked at the same time each with their own unique impact callback context.

These changes will be available in the next update
 
Someone mentioned that this was still not working as intended in the last update.
I found the issue and it will be fixed in the next update
 
Can confirm: latest update not working as intended.
I also opened a thread for few quality of life improvements.
They are all small things, but they are things that I find myself changing in opsive code, rather than extending, so having them built-in would be nice because the changes get wiped when I update UCC. (Just to note: I am aware that I am making temporary changes that will need to be re-implemented after every update).

 
Top