From: "Enrico Weigelt, metux IT consult" <enrico.weig...@gr13.net>
--- src/net/sf/freecol/client/control/InGameController.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/net/sf/freecol/client/control/InGameController.java b/src/net/sf/freecol/client/control/InGameController.java index ba06c1c1acf..9fa126560c0 100644 --- a/src/net/sf/freecol/client/control/InGameController.java +++ b/src/net/sf/freecol/client/control/InGameController.java @@ -1144,20 +1144,22 @@ public final class InGameController extends FreeColClientHolder { */ private boolean movePath(Unit unit, PathNode path) { for (; path != null; path = path.next) { - if (unit.isAtLocation(path.getLocation())) continue; + Location location = path.getLocation(); + if (unit.isAtLocation(location)) continue; - if (path.getLocation() instanceof Europe) { + if (location instanceof Europe) { if (unit.hasTile() && unit.getTile().isDirectlyHighSeasConnected()) { - moveTo(unit, path.getLocation()); + moveTo(unit, location); } else { logger.warning("Can not move to Europe from " + unit.getLocation() + " on path: " + path.fullPathToString()); } return false; - } else if (path.getLocation() instanceof Tile) { - if (path.getDirection() == null) { + } else if (location instanceof Tile) { + Direction direction = path.getDirection(); + if (direction == null) { if (unit.isInEurope()) { moveTo(unit, unit.getGame().getMap()); } else { @@ -1166,7 +1168,7 @@ public final class InGameController extends FreeColClientHolder { } return false; } else { - if (!moveDirection(unit, path.getDirection(), false)) { + if (!moveDirection(unit, direction, false)) { return false; } if (unit.hasTile() @@ -1176,7 +1178,7 @@ public final class InGameController extends FreeColClientHolder { return false; } } - } else if (path.getLocation() instanceof Unit) { + } else if (location instanceof Unit) { return moveEmbark(unit, path.getDirection()); } else { -- 2.11.0.rc0.7.gbe5a750 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Freecol-developers mailing list Freecol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freecol-developers