Skip to content

Commit

Permalink
Merge pull request #5269 from kuronekochomusuke/issue_5268
Browse files Browse the repository at this point in the history
fix npe on skip movement
  • Loading branch information
HammerGS authored Mar 20, 2024
2 parents 7e5105c + fdc9e84 commit ee387c1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions megamek/src/megamek/client/ui/swing/MovementDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,8 @@ && ce().canUnjamRAC()

if (needNagForOther()) {
if ((ce() != null)
&& (null != cmd)) {
&& (null != cmd)
&& ce().isAero()) {
boolean airborneOrSpaceborne = ce().isAirborne()
|| ce().isSpaceborne();
boolean unusedVelocity = false;
Expand All @@ -1667,7 +1668,6 @@ && ce().canUnjamRAC()
|| cmd.contains(MoveStepType.RETURN);
if (airborneOrSpaceborne
&& !clientgui.getClient().getGame().useVectorMove()
&& ce().isAero()
&& !((IAero) ce()).isOutControlTotal()
&& unusedVelocity
&& !offOrReturn
Expand Down Expand Up @@ -1697,16 +1697,16 @@ && ce().isAssaultDropInProgress()
}

if (needNagForOther()) {
if (ce() != null) {
if (ce() != null
&& (ce() instanceof Infantry)
&& ((Infantry) ce()).hasMicrolite()
) {
boolean finalElevation = (ce().getElevation() != cmd.getFinalElevation());
boolean airborneVTOLOrWIGEOrFinalElevation = ce().isAirborneVTOLorWIGE()
|| finalElevation;
int terrainLevelBuilding = ce().getGame().getBoard().getHex(cmd.getFinalCoords()).terrainLevel(Terrains.BLDG_ELEV);
int terrainLevelBridge = ce().getGame().getBoard().getHex(cmd.getFinalCoords()).terrainLevel(Terrains.BRIDGE_ELEV);
if ((ce() != null)
&& (ce() instanceof Infantry)
&& ((Infantry) ce()).hasMicrolite()
&& airborneVTOLOrWIGEOrFinalElevation
if (airborneVTOLOrWIGEOrFinalElevation
&& !cmd.contains(MoveStepType.FORWARDS)
&& !cmd.contains(MoveStepType.FLEE)
&& cmd.getFinalElevation() > 0
Expand Down

0 comments on commit ee387c1

Please sign in to comment.