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

Red Alert: Chronosphere-teleport to a mine doesn't damage units #14262

Open
Diranus opened this issue Oct 24, 2017 · 9 comments
Open

Red Alert: Chronosphere-teleport to a mine doesn't damage units #14262

Diranus opened this issue Oct 24, 2017 · 9 comments

Comments

@Diranus
Copy link

Diranus commented Oct 24, 2017

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.

@abcdefg30 abcdefg30 added the Bug label Oct 26, 2017
@penev92
Copy link
Member

penev92 commented Nov 9, 2017

This seems like a slight oversight that is pretty simple to fix.

@penev92 penev92 added the Easy label Nov 9, 2017
@reaperrr reaperrr added this to the Next release milestone Nov 19, 2017
@pchote
Copy link
Member

pchote commented Nov 25, 2017

#14327 was closed. Does somebody else want to take this over, or are we going to drop this from the milestone?

@penev92 penev92 removed this from the Next release milestone Nov 25, 2017
@ResourceHog
Copy link

I'm willing to take it up.

@penev92
Copy link
Member

penev92 commented Nov 27, 2017

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.

@abcdefg30
Copy link
Member

I'm willing to take it up.

👍

@abcdefg30
Copy link
Member

@ResourceHog do you still want to work on this?

@xecollons
Copy link
Contributor

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.

@abcdefg30
Copy link
Member

Sure, feel free to continue from where #14327 stopped (or your own idea).

@abcdefg30
Copy link
Member

#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 ActorMap is notified to remove the actor from the old position and add it to the new position the next time Tick runs
  • The position update triggers a INotifyCrushed.OnCrush call 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants