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

---
 src/net/sf/freecol/common/model/WorkLocation.java | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/net/sf/freecol/common/model/WorkLocation.java 
b/src/net/sf/freecol/common/model/WorkLocation.java
index 4d0abd480df..48d52a459e3 100644
--- a/src/net/sf/freecol/common/model/WorkLocation.java
+++ b/src/net/sf/freecol/common/model/WorkLocation.java
@@ -24,7 +24,6 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
-import java.util.function.ToIntFunction;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.stream.Stream;
@@ -329,9 +328,11 @@ public abstract class WorkLocation extends UnitLocation
             delta -= getPotentialProduction(goodsType, unit.getType());
         }
         // Do we have a chance of satisfying the inputs?
-        final ToIntFunction<AbstractGoods> prod = ag ->
-            colony.getNetProductionOf(ag.getType());
-        delta = Math.min(delta, min(productionType.getInputs(), prod));
+        for (AbstractGoods ag : productionType.getInputs()) {
+            int v = colony.getNetProductionOf(ag.getType());
+            if (v < delta) delta = v;
+        }
+
         if (delta <= 0) return null;
 
         // Is the production actually a good idea?  Not if we are independent
-- 
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