From: "Enrico Weigelt, metux IT consult" <[email protected]>
---
src/net/sf/freecol/common/model/UnitChangeType.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/net/sf/freecol/common/model/UnitChangeType.java
b/src/net/sf/freecol/common/model/UnitChangeType.java
index d65b501358c..0c5e3ce8449 100644
--- a/src/net/sf/freecol/common/model/UnitChangeType.java
+++ b/src/net/sf/freecol/common/model/UnitChangeType.java
@@ -223,8 +223,11 @@ public class UnitChangeType extends FreeColSpecObjectType {
* change is impossible.
*/
public UnitChange getUnitChange(UnitType fromType, final UnitType toType) {
- return find(getUnitChanges(fromType),
- ((toType == null) ? alwaysTrue() : uc -> uc.to == toType));
+ for (UnitChange uc : getUnitChanges(fromType))
+ if (toType == null || uc.to == toType)
+ return uc;
+
+ return null;
}
// @compat 0.11.6
--
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