From: "Enrico Weigelt, metux IT consult" <[email protected]>
---
src/net/sf/freecol/common/model/WorkLocation.java | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/net/sf/freecol/common/model/WorkLocation.java
b/src/net/sf/freecol/common/model/WorkLocation.java
index 48d52a459e3..74362e90ac3 100644
--- a/src/net/sf/freecol/common/model/WorkLocation.java
+++ b/src/net/sf/freecol/common/model/WorkLocation.java
@@ -544,10 +544,17 @@ public abstract class WorkLocation extends UnitLocation
public UnitType getExpertUnitType() {
final Specification spec = getSpecification();
ProductionType pt = getBestProductionType(false, null);
- return (pt == null) ? null
- : find(map(pt.getOutputs(),
- ag -> spec.getExpertForProducing(ag.getType())),
- isNotNull());
+
+ if (pt == null)
+ return null;
+
+ for (AbstractGoods ag : pt.getOutputs()) {
+ UnitType ut = spec.getExpertForProducing(ag.getType());
+ if (ut != null)
+ return ut;
+ }
+
+ return null;
}
/**
--
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