From 9fc2510fe08dc62da6c034dd9026e47e7a980bd2 Mon Sep 17 00:00:00 2001 From: SeventhM <127357473+SeventhM@users.noreply.github.com> Date: Wed, 22 Jan 2025 07:39:02 -0800 Subject: [PATCH] Allow building improvements on terrains that only allow some improvements when it has multiple uniques (#12847) * Allow building improvements on terrains that only allow some improvements when it has multiple uniques * Whoops, accidentally disallowed all improvements --- .../com/unciv/logic/map/tile/TileImprovementFunctions.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/com/unciv/logic/map/tile/TileImprovementFunctions.kt b/core/src/com/unciv/logic/map/tile/TileImprovementFunctions.kt index d31fd12392..ee663f8e99 100644 --- a/core/src/com/unciv/logic/map/tile/TileImprovementFunctions.kt +++ b/core/src/com/unciv/logic/map/tile/TileImprovementFunctions.kt @@ -149,9 +149,10 @@ class TileImprovementFunctions(val tile: Tile) { tile.lastTerrain.unbuildable && !improvement.canBeBuiltOnThisUnbuildableTerrain(knownFeatureRemovals) -> false // Can't build if any terrain specifically prevents building this improvement - tile.getTerrainMatchingUniques(UniqueType.RestrictedBuildableImprovements, stateForConditionals).any { - unique -> !improvement.matchesFilter(unique.params[0], StateForConditionals(tile = tile)) - } -> false + tile.getTerrainMatchingUniques(UniqueType.RestrictedBuildableImprovements, stateForConditionals).toList() + .let { it.any() && it.none { + unique -> improvement.matchesFilter(unique.params[0], StateForConditionals(tile = tile)) + } } -> false // Can't build if the improvement specifically prevents building on some present feature improvement.getMatchingUniques(UniqueType.CannotBuildOnTile, stateForConditionals).any {