Fixed idiotic bug that caused the game to crash =(

This commit is contained in:
Yair Morgenstern 2018-05-10 11:01:55 +03:00
parent d12b665e83
commit 4c4abb452c
4 changed files with 6 additions and 4 deletions

View File

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.game"
minSdkVersion 14
targetSdkVersion 26
versionCode 49
versionName "2.1.0"
versionCode 52
versionName "2.1.2"
}
buildTypes {
release {

View File

@ -84,6 +84,7 @@ class UnitAutomation{
val closestCityWithoutUnit = reachableCitiesWithoutUnits
.minBy { unit.movementAlgs().getShortestPath(it.getCenterTile()).size }!!
unit.movementAlgs().headTowards(closestCityWithoutUnit.getCenterTile())
return
}
if (unit.health < 80) {

View File

@ -88,6 +88,7 @@ class CityInfo {
// we need to check which other cities exist globally and name accordingly
val allExistingCityNames = civInfo.gameInfo.civilizations.flatMap { it.cities }.map { it.name }.toHashSet()
name = civInfo.getCivilization().cities.first { !allExistingCityNames.contains(it) }
this.location = cityLocation
civInfo.cities.add(this)
if(civInfo == civInfo.gameInfo.getPlayerCivilization())
@ -135,7 +136,7 @@ class CityInfo {
internal fun getMaxHealth(): Int {
return 200 // add more later when walls citadl etc.
return 200 // add more later when walls citadel etc.
}
override fun toString(): String {return name} // for debug

View File

@ -27,7 +27,7 @@ class CivStatsTable(val screen: WorldScreen) : Table() {
background = civBackground.tint(Color(0x004085e0))
val resourceTable = Table()
resourceTable.defaults().pad(10f)
resourceTable.defaults().pad(5f)
val revealedStrategicResources = GameBasics.TileResources.values
.filter { it.resourceType== ResourceType.Strategic} // && civInfo.tech.isResearched(it.revealedBy!!) }
for(resource in revealedStrategicResources){