Skip to content

Commit

Permalink
Merge pull request #6253 from psikomonkie/issue-6224-npe-air-out-of-b…
Browse files Browse the repository at this point in the history
…ounds

Issue 6224: NPE when air fails maneuver and flies off map
  • Loading branch information
SJuliez authored Dec 14, 2024
2 parents 6234f4b + 087278c commit 20f7ea3
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 20f7ea3

Please sign in to comment.