From 087278c0c2dbdde880efc97d3613c8c8bbc40a47 Mon Sep 17 00:00:00 2001 From: psikomonkie <189469115+psikomonkie@users.noreply.github.com> Date: Mon, 9 Dec 2024 20:10:25 -0500 Subject: [PATCH] Issue 6224: NPE when air fails maneuver and flies off map --- megamek/src/megamek/server/totalwarfare/MovePathHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/megamek/src/megamek/server/totalwarfare/MovePathHandler.java b/megamek/src/megamek/server/totalwarfare/MovePathHandler.java index bb0aaa246e8..e7ff875e51d 100644 --- a/megamek/src/megamek/server/totalwarfare/MovePathHandler.java +++ b/megamek/src/megamek/server/totalwarfare/MovePathHandler.java @@ -1561,6 +1561,7 @@ private void processSteps() { a.setStraightMoves(a.getStraightMoves() + 1); // make sure it didn't fly off the map if (!getGame().getBoard().contains(curPos)) { + curPos = curPos.translated(step.getFacing(), -1); //Return its position to on-map so it can be targeted this turn a.setCurrentVelocity(md.getFinalVelocity()); gameManager.processLeaveMap(md, true, Compute.roundsUntilReturn(getGame(), entity)); return;