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

HeliFly.cs activity hangs the game (zero minimum range case) #13307

Closed
forcecore opened this issue May 16, 2017 · 2 comments
Closed

HeliFly.cs activity hangs the game (zero minimum range case) #13307

forcecore opened this issue May 16, 2017 · 2 comments
Labels

Comments

@forcecore
Copy link
Contributor

forcecore commented May 16, 2017

Infinite loop:

A helicopter is very likely to hover over the target when controlled by AI. In this case

  • HeliFly.tick() : Try to move towards target evaluates that the helicopter is inside the maximum range of the weapon so it thinks that it may proceed to Attack activity.
  • Attack.cs, InnerTick(): However, this one thinks it needs to move, because
			if (!Target.IsInRange(self.CenterPosition, maxRange) || Target.IsInRange(self.CenterPosition, minRange)
				|| (mobile != null && !mobile.CanInteractWithGroundLayer(self)))
  • The first expression correctly evaluates that the helicopter is in maxRange, proceeds to the next expr.
  • The second one, evaluates that target is in minimumRange.
  • IsInRange is INCLUSIVE and Helicopters with minRange of 0 will think that it needs to move away out of minimum range.
  • Then it goes to HeliFly.tick() to move again then comes back to attack because it is within maximum range.

There's nothing that prevents modders having 0 range for helis!
Another thing is that 0 range makes sense when the "helicopter" is an airborne aircraft carrier!

@abcdefg30 abcdefg30 added the Bug label May 16, 2017
@abcdefg30
Copy link
Member

I think this is also related to the bug, that you can't paradrop units at 0 range.

@GraionDilach
Copy link
Contributor

GraionDilach commented May 16, 2017

Oh yes, this is the bug which is why all jumpjets in RA2 has a minrange of (0c00)1. This bug actually have triggered there when the Kirov could fly directly above a target.

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

No branches or pull requests

3 participants