mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-03 13:30:51 +07:00
Pass in civ for building on tiles (#11861)
This commit is contained in:
parent
bebc769120
commit
e5e52fe916
@ -157,14 +157,14 @@ class TileImprovementFunctions(val tile: Tile) {
|
||||
|
||||
// Can't build if the improvement specifically prevents building on some present feature
|
||||
improvement.getMatchingUniques(UniqueType.CannotBuildOnTile, stateForConditionals).any {
|
||||
unique -> tile.matchesTerrainFilter(unique.params[0])
|
||||
unique -> tile.matchesFilter(unique.params[0], stateForConditionals.civInfo)
|
||||
} ->
|
||||
false
|
||||
|
||||
// Can't build if an improvement is only allowed to be built on specific tiles and this is not one of them
|
||||
// If multiple uniques of this type exists, we want all to match (e.g. Hill _and_ Forest would be meaningful)
|
||||
improvement.getMatchingUniques(UniqueType.CanOnlyBeBuiltOnTile, stateForConditionals).let {
|
||||
it.any() && it.any { unique -> !tile.matchesTerrainFilter(unique.params[0]) }
|
||||
it.any() && it.any { unique -> !tile.matchesFilter(unique.params[0], stateForConditionals.civInfo) }
|
||||
} -> false
|
||||
|
||||
// Can't build if the improvement requires an adjacent terrain that is not present
|
||||
|
Loading…
Reference in New Issue
Block a user