mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-07 14:02:48 +07:00
Fixed bug where cities would not "recognize" tiles on the first turn - for realz this time
This commit is contained in:
parent
c6e344b16e
commit
5d4003ecbf
@ -33,7 +33,7 @@ class CityInfo {
|
||||
fun getCenterTile(): TileInfo = tileMap[location]
|
||||
fun getTiles(): List<TileInfo> = tiles.map { tileMap[it] }
|
||||
|
||||
fun getTilesInRange(): List<TileInfo> = getCenterTile().getTilesInDistance( 3).filter { civInfo == it.getOwner() }
|
||||
fun getTilesInRange(): List<TileInfo> = 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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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() })
|
||||
|
Loading…
Reference in New Issue
Block a user