Red Alert: Chronosphere-teleport to a mine doesn't damage units
Hello,
if you use the chronosphere to teleport an unit (I tested this with a MCV) on top of a mine, the mine will explode, but the unit won't receive damage.
This seems like a slight oversight that is pretty simple to fix.
#14327 was closed. Does somebody else want to take this over, or are we going to drop this from the milestone?
I'm willing to take it up.
While I have personal reasons to not want that fixed in the near future, I can't say "no" to a new contributor that is willing to fix things.
I'm willing to take it up.
👍
@ResourceHog do you still want to work on this?
Hello,
I'll take a look at this if no one volunteers. But, for what I have seen, maybe it's not an easy fix for newcomers, or, at least, for me :D It seems that the position update in ActorMap is being done after the teleport tick, so, when the mine tries to find who to harm after exploding(using the "FindActorsInCircle" method), doesn't find the mobile actor.
Sure, feel free to continue from where #14327 stopped (or your own idea).
https://github.com/OpenRA/OpenRA/pull/14327 was not the correct fix. It seems that the following is happening for both teleported units and paratroopers:
- The unit's position is updated (
IPositionable.SetPosition) - The
ActorMapis notified to remove the actor from the old position and add it to the new position the next timeTickruns - The position update triggers a
INotifyCrushed.OnCrushcall and the mine explodes - The explosion targets the cell the mine is in, the actor map is used to determine which actors are in this cell
- Since the actor map has not updated the actor positions yet, the new actor is not affected by the explosion
An easy testcase is adding Delay: 1 to the damage warhead of the mines, which works around this problem.