diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index 3275228e23..4f7cff079a 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -33,7 +33,7 @@ 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 @@ -92,6 +92,7 @@ class CityInfo { } expansion.reset() + civInfo.gameInfo.updateTilesToCities() val tile = getCenterTile() tile.roadStatus = RoadStatus.Railroad diff --git a/core/src/com/unciv/models/gamebasics/Building.kt b/core/src/com/unciv/models/gamebasics/Building.kt index 17dcb7ecaf..ac928c04b0 100644 --- a/core/src/com/unciv/models/gamebasics/Building.kt +++ b/core/src/com/unciv/models/gamebasics/Building.kt @@ -151,10 +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 + && it.getOwner() == civInfo } if (!containsResourceWithImprovement) return false } diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt index fbe31b1c99..d2bc91d515 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt @@ -62,7 +62,6 @@ class UnitActions { unit.civInfo.addCity(tile.position) unitTable.currentlyExecutingAction = null // In case the settler was in the middle of doing something and we then founded a city with it tile.unit = null // Remove settler! - unit.civInfo.gameInfo.updateTilesToCities() }, unit.currentMovement != 0f && !tile.getTilesInDistance(2).any { it.isCityCenter() })