From: "Enrico Weigelt, metux IT consult" <[email protected]>
---
src/net/sf/freecol/common/model/Occupation.java | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/net/sf/freecol/common/model/Occupation.java
b/src/net/sf/freecol/common/model/Occupation.java
index 3dd4934e478..0149b10d22e 100644
--- a/src/net/sf/freecol/common/model/Occupation.java
+++ b/src/net/sf/freecol/common/model/Occupation.java
@@ -101,10 +101,17 @@ public class Occupation {
for (ProductionType pt : transform(productionTypes, isNotNull())) {
lb.add("\n try=", pt);
- for (GoodsType gt : transform(workTypes, isNotNull(g ->
pt.getOutput(g)))) {
- int minInput = min(pt.getInputs(),
- ag -> Math.max(colony.getNetProductionOf(ag.getType()),
- colony.getGoodsCount(ag.getType())));
+ for (GoodsType gt : workTypes) {
+ if (pt.getOutput(gt) == null)
+ continue;
+
+ int minInput = Integer.MAX_VALUE;
+ for (AbstractGoods ag : pt.getInputs()) {
+ minInput = Math.min(minInput,
+ Math.max(colony.getNetProductionOf(ag.getType()),
+ colony.getGoodsCount(ag.getType())));
+ }
+
int potential = wl.getPotentialProduction(gt, unitType);
int amount = Math.min(minInput, potential);
lb.add(" ", gt.getSuffix(), "=", amount, "/", minInput,
--
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/freecol-developers