Skip to content

Conversation

@HammerGS
Copy link
Member

@HammerGS HammerGS commented Jan 2, 2026

Summary

Fixes #7848

Aerodyne aircraft (fighters, aerospace fighters, aerodyne DropShips) could move backwards in atmosphere using Shift+S keybind, allowing them to fly in reverse while retaining full combat functionality.

Root Cause

The airborne movement legality section in MoveStep.java had no restriction preventing BACKWARDS movement for aerodyne aircraft in atmosphere. While non-Aero airborne units (like LandAirMek in flight mode) were already restricted to only turns and conversion, true Aero units could use any movement type including backwards.

Fix

Added a check in the atmosphere movement rules section (after the turning rules) to prevent backwards movement for aerodyne aircraft:

  ```java
  // aerodynes cannot fly backwards in atmosphere
  if (useAeroAtmosphere(game, entity) &&
        ((type == MoveStepType.BACKWARDS) ||
              (type == MoveStepType.LATERAL_LEFT_BACKWARDS) ||
              (type == MoveStepType.LATERAL_RIGHT_BACKWARDS))) {
      return;
  }

Scope

Unit Type Affected? Reason
Conventional Fighter Yes Aerodyne, requires forward flight
Aerospace Fighter Yes Aerodyne, requires forward flight
Aerodyne DropShip Yes Aerodyne, requires forward flight
Spheroid DropShip No Hovers like VTOL, different movement
Landed aircraft No At altitude 0, different code path
Space movement No Different movement rules

  File: megamek/src/megamek/common/moves/MoveStep.java:1627-1633

  Change: Added restriction preventing aerodyne aircraft from flying backwards in atmosphere:

  // aerodynes cannot fly backwards in atmosphere
  if (useAeroAtmosphere(game, entity) &&
        ((type == MoveStepType.BACKWARDS) ||
              (type == MoveStepType.LATERAL_LEFT_BACKWARDS) ||
              (type == MoveStepType.LATERAL_RIGHT_BACKWARDS))) {
      return;
  }

  Affected Units:
  - Conventional Fighters
  - Aerospace Fighters
  - Aerodyne DropShips

  Not Affected:
  - Spheroid DropShips (hover movement)
  - Landed aircraft (different code path)
  - Space movement (different rules)
Copilot AI review requested due to automatic review settings January 2, 2026 04:36
@HammerGS HammerGS requested a review from a team as a code owner January 2, 2026 04:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issue #7848 by preventing aerodyne aircraft from moving backwards while flying in atmosphere. The fix adds a validation check that blocks backwards movement types (BACKWARDS, LATERAL_LEFT_BACKWARDS, LATERAL_RIGHT_BACKWARDS) for aerodyne aircraft operating in atmospheric conditions.

Key Changes:

  • Added backwards movement restriction for aerodyne aircraft in atmosphere within the compileIllegal method
  • The restriction only applies to aerodynes (not spheroids) when airborne in non-vacuum atmosphere
  • Space movement and landed aircraft are unaffected

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HammerGS HammerGS added AI Generated Fix AI-generated fix. Requires human testing and review before merging. AI ready for Review Indicates that is has been in game tested and is ready for review as it can be labels Jan 2, 2026
@HammerGS HammerGS merged commit 69061b3 into main Jan 6, 2026
12 checks passed
@HammerGS HammerGS deleted the fix-7848-aircraft-moving-backwards branch January 6, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Fix AI-generated fix. Requires human testing and review before merging. AI ready for Review Indicates that is has been in game tested and is ready for review as it can be

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] Moving backwards with plane

3 participants