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
This commit is contained in:
SeventhM 2025-01-22 07:39:02 -08:00 committed by GitHub
parent f5ec43b8f2
commit 9fc2510fe0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {