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

Allow free facing change only after aerospace maneuvers that allow it. #4663

Merged
merged 2 commits into from
Jul 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion megamek/src/megamek/common/MoveStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -3895,10 +3895,11 @@ public boolean canAeroTurn(Game game) {
}

// if its part of a maneuver then you can turn
if (isManeuver()) {
if (isFacingChangeManeuver()) {
return true;
}


if (en instanceof ConvFighter) {
// conventional fighters can only turn on free turns or maneuvers
return false;
Expand Down Expand Up @@ -4010,6 +4011,17 @@ public boolean isManeuver() {
return maneuver;
}

/**
* @return Whether this step is a maneuver that allows a free facing change.
*/
public boolean isFacingChangeManeuver() {
return maneuver && (
maneuverType == ManeuverType.MAN_HAMMERHEAD
|| maneuverType == ManeuverType.MAN_IMMELMAN
|| maneuverType == ManeuverType.MAN_SPLIT_S
);
}

public Minefield getMinefield() {
return mf;
}
Expand Down