From: "Enrico Weigelt, metux IT consult" <enrico.weig...@gr13.net>
--- src/net/sf/freecol/common/model/Unit.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/net/sf/freecol/common/model/Unit.java b/src/net/sf/freecol/common/model/Unit.java index 820480f2b39..b8e5ffa53e5 100644 --- a/src/net/sf/freecol/common/model/Unit.java +++ b/src/net/sf/freecol/common/model/Unit.java @@ -2654,8 +2654,20 @@ public class Unit extends GoodsLocation // Owner has no settlements. If it is the REF, start from a // rebel colony. Prefer the closest port. if (owner.isREF()) { - return minimize(flatten(owner.getRebels(), Player::getSettlements), - settlementStartComparator); + Settlement best = null; + int best_dist = INFINITY; + for (Player p : owner.getRebels()) { + for (Settlement s : p.getSettlements()) { + int hsc = s.getTile().getHighSeasCount(); + if (hsc < 0) hsc = INFINITY; + if (best == null || hsc < best_dist) { + best = s; + best_dist = hsc; + } + } + } + + return best; } // Desperately find the nearest land to the entry location. -- 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