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

Fix Immelman and Split-S maneuvers #4820

Merged
merged 2 commits into from
Oct 9, 2023
Merged

Conversation

neoancient
Copy link
Member

This fixes a bug I introduced in #4663. The change assumes that the maneuver type is set in the previous step, but it was only being set in the movement step and not the subsequent steps that implement the effects of the maneuver. I've changed it to include the maneuver type with all steps that are part of the maneuver, and this time I tested every maneuver type to make sure it's working.

Fixes #4791.

Comment on lines +570 to -573
} else if (step.isManeuver()) {
step = new MoveStep(this, step.getType(), step.hasNoCost(), step.isManeuver(), step.getManeuverType());
} else if (step.getManeuverType() != ManeuverType.MAN_NONE) {
step = new MoveStep(this, step.getType(), -1, -1, step.getManeuverType());
} else if (step.isManeuver()) {
step = new MoveStep(this, step.getType(), step.hasNoCost(), step.isManeuver());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change in order was required to preserve the noCost field of the additional steps of the maneuver. I thought the check for maneuverType could be removed along with the constructor it uses, but when I tried that all the maneuvers lost their thrust costs. I decided to leave well enough alone.

Copy link
Member

@NickAragua NickAragua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same idea, but you beat me to it.

@HammerGS HammerGS merged commit f6676e3 into master Oct 9, 2023
HammerGS added a commit that referenced this pull request Oct 9, 2023
+ Fix #4820: Fix Immelman and Split-S maneuvers
+ PR #4818: Separate structure class from TestEntity
+ PR #4816: TestTank: Adapt some tests for GunEmplacements
@neoancient neoancient deleted the aero_maneuver_facing_change branch November 2, 2023 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[49.14] Immelmann and Split-S maneuvers not allowing selection of any facing
3 participants