Skip to content

Commit

Permalink
Allow building improvements on terrains that only allow some improvem…
Browse files Browse the repository at this point in the history
…ents 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
  • Loading branch information
SeventhM authored Jan 22, 2025
1 parent f5ec43b commit 9fc2510
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/src/com/unciv/logic/map/tile/TileImprovementFunctions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9fc2510

Please sign in to comment.