From 6e7e05248d384f463924b2214a6501532347ac1b Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 18 Jun 2021 10:40:54 +0300 Subject: [PATCH] Fixed crash caused by #4142 --- core/src/com/unciv/logic/map/TileInfo.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index 6d0bcfa26a..67f82c019e 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -291,8 +291,12 @@ open class TileInfo { && observingCiv.tech.isResearched(it.params[2]) } for (unique in cityWideUniques + improvementUniques) { - if (matchesUniqueFilter(unique.params[1])) - stats.add(unique.stats) + if (matchesUniqueFilter(unique.params[1]) + // Freshwater and non-freshwater cannot be moved to matchesUniqueFilter since that creates an enless feedback. + // If you're attempting that, check that it works! + || unique.params[1] == "Fresh water" && isAdjacentToFreshwater + || unique.params[1] == "non-fresh water" && !isAdjacentToFreshwater) + stats.add(unique.stats) } for (unique in city.civInfo.getMatchingUniques("[] from every []")) { @@ -399,8 +403,6 @@ open class TileInfo { "Land" -> isLand "Coastal" -> isCoastalTile() "River" -> isAdjacentToRiver() - "Fresh water" -> isAdjacentToFreshwater - "non-fresh water" -> !isAdjacentToFreshwater improvement -> true naturalWonder -> true "Foreign Land" -> civInfo != null && !isFriendlyTerritory(civInfo)