diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index 856c99df0e..6adcc66096 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -33,14 +33,14 @@ class CityInfo { fun getCenterTile(): TileInfo = tileMap[location] fun getTiles(): List = tiles.map { tileMap[it] } - fun getTilesInRange(): List = getCenterTile().getTilesInDistance( 3).filter { civInfo == it.getOwner() } + fun getTilesInRange(): List = getCenterTile().getTilesInDistance( 3) // Remove resources required by buildings fun getCityResources(): Counter { val cityResources = Counter() - for (tileInfo in getTilesInRange().filter { it.resource != null }) { + for (tileInfo in getTiles().filter { it.resource != null }) { val resource = tileInfo.tileResource if (resource.improvement == tileInfo.improvement || tileInfo.isCityCenter()) cityResources.add(resource, 1) @@ -77,7 +77,6 @@ class CityInfo { constructor(civInfo: CivilizationInfo, cityLocation: Vector2) { - this.civInfo = civInfo setTransients() @@ -94,7 +93,6 @@ class CityInfo { expansion.reset() - val tile = getCenterTile() tile.roadStatus = RoadStatus.Railroad if (listOf("Forest", "Jungle", "Marsh").contains(tile.terrainFeature)) diff --git a/core/src/com/unciv/models/gamebasics/Building.kt b/core/src/com/unciv/models/gamebasics/Building.kt index 879d12600e..17dcb7ecaf 100644 --- a/core/src/com/unciv/models/gamebasics/Building.kt +++ b/core/src/com/unciv/models/gamebasics/Building.kt @@ -151,9 +151,10 @@ class Building : NamedStats(), IConstruction, ICivilopedia { if (requiredNearbyImprovedResources != null) { val containsResourceWithImprovement = construction.cityInfo.getTilesInRange() .any { - it.resource != null + it.resource != null && requiredNearbyImprovedResources!!.contains(it.resource!!) && it.tileResource.improvement == it.improvement + && it.getOwner() == civInfo } if (!containsResourceWithImprovement) return false }