mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-30 15:30:43 -04:00
Cities now only take ownership of _unowned_ tiles around them
This commit is contained in:
parent
9a72623499
commit
89a720f7b2
@ -21,8 +21,8 @@ android {
|
|||||||
applicationId "com.unciv.app"
|
applicationId "com.unciv.app"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 221
|
versionCode 223
|
||||||
versionName "2.14.2"
|
versionName "2.14.3"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Had to add this crap for Travis to build, it wanted to sign the app
|
// Had to add this crap for Travis to build, it wanted to sign the app
|
||||||
|
@ -76,7 +76,9 @@ class CityExpansionManager {
|
|||||||
for(tile in cityInfo.tiles.map { cityInfo.tileMap[it] })
|
for(tile in cityInfo.tiles.map { cityInfo.tileMap[it] })
|
||||||
relinquishOwnership(tile)
|
relinquishOwnership(tile)
|
||||||
|
|
||||||
cityInfo.getCenterTile().getTilesInDistance(1).forEach { takeOwnership(it) }
|
cityInfo.getCenterTile().getTilesInDistance(1)
|
||||||
|
.filter { it.getCity()!=null } // can't take ownership of owned tiles
|
||||||
|
.forEach { takeOwnership(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addNewTileWithCulture() {
|
private fun addNewTileWithCulture() {
|
||||||
@ -97,7 +99,8 @@ class CityExpansionManager {
|
|||||||
|
|
||||||
fun takeOwnership(tileInfo: TileInfo){
|
fun takeOwnership(tileInfo: TileInfo){
|
||||||
if(tileInfo.isCityCenter()) throw Exception("What?!")
|
if(tileInfo.isCityCenter()) throw Exception("What?!")
|
||||||
if(tileInfo.getCity()!=null) tileInfo.getCity()!!.expansion.relinquishOwnership(tileInfo)
|
if(tileInfo.getCity()!=null)
|
||||||
|
tileInfo.getCity()!!.expansion.relinquishOwnership(tileInfo)
|
||||||
|
|
||||||
cityInfo.tiles = cityInfo.tiles.withItem(tileInfo.position)
|
cityInfo.tiles = cityInfo.tiles.withItem(tileInfo.position)
|
||||||
tileInfo.owningCity = cityInfo
|
tileInfo.owningCity = cityInfo
|
||||||
|
@ -43,7 +43,7 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre
|
|||||||
else {
|
else {
|
||||||
pickProductionButton.color = Color.GRAY
|
pickProductionButton.color = Color.GRAY
|
||||||
pickProductionButton.row()
|
pickProductionButton.row()
|
||||||
pickProductionButton.add(rejectionReason.toLabel().setFontColor(Color.RED))
|
pickProductionButton.add(rejectionReason.toLabel().setFontColor(Color.RED)).colspan(pickProductionButton.columns)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(construction==cityScreen.city.cityConstructions.currentConstruction)
|
if(construction==cityScreen.city.cityConstructions.currentConstruction)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user