From: "Enrico Weigelt, metux IT consult" <enrico.weig...@gr13.net>

---
 src/net/sf/freecol/common/model/Player.java | 2 +-
 src/net/sf/freecol/common/model/Unit.java   | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/net/sf/freecol/common/model/Player.java 
b/src/net/sf/freecol/common/model/Player.java
index cd2a584bc1f..5aad8c26fdf 100644
--- a/src/net/sf/freecol/common/model/Player.java
+++ b/src/net/sf/freecol/common/model/Player.java
@@ -987,7 +987,7 @@ public class Player extends FreeColGameObject implements 
Nameable {
      *     world or a nation is in rebellion against us.
      */
     public boolean isWorkForREF() {
-        return (any(getUnits(), Unit::hasTile))
+        return Unit.anyHasTile(getUnits())
             ? true // Work to do still if there exists a unit in the new world
             : !getRebels().isEmpty();
     }
diff --git a/src/net/sf/freecol/common/model/Unit.java 
b/src/net/sf/freecol/common/model/Unit.java
index e2a7394c377..820480f2b39 100644
--- a/src/net/sf/freecol/common/model/Unit.java
+++ b/src/net/sf/freecol/common/model/Unit.java
@@ -999,6 +999,13 @@ public class Unit extends GoodsLocation
         return getTile() != null;
     }
 
+    public static boolean anyHasTile(List<Unit> units) {
+        if (units != null)
+            for (Unit u : units)
+                if (u.hasTile()) return true;
+        return false;
+    }
+
     /**
      * Gets the work location this unit is working in.
      *
-- 
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

Reply via email to