mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 05:09:25 +07:00
Fixed idiotic bug that caused the game to crash =(
This commit is contained in:
@ -21,8 +21,8 @@ android {
|
|||||||
applicationId "com.unciv.game"
|
applicationId "com.unciv.game"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode 49
|
versionCode 52
|
||||||
versionName "2.1.0"
|
versionName "2.1.2"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
@ -84,6 +84,7 @@ class UnitAutomation{
|
|||||||
val closestCityWithoutUnit = reachableCitiesWithoutUnits
|
val closestCityWithoutUnit = reachableCitiesWithoutUnits
|
||||||
.minBy { unit.movementAlgs().getShortestPath(it.getCenterTile()).size }!!
|
.minBy { unit.movementAlgs().getShortestPath(it.getCenterTile()).size }!!
|
||||||
unit.movementAlgs().headTowards(closestCityWithoutUnit.getCenterTile())
|
unit.movementAlgs().headTowards(closestCityWithoutUnit.getCenterTile())
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unit.health < 80) {
|
if (unit.health < 80) {
|
||||||
|
@ -88,6 +88,7 @@ class CityInfo {
|
|||||||
// we need to check which other cities exist globally and name accordingly
|
// we need to check which other cities exist globally and name accordingly
|
||||||
val allExistingCityNames = civInfo.gameInfo.civilizations.flatMap { it.cities }.map { it.name }.toHashSet()
|
val allExistingCityNames = civInfo.gameInfo.civilizations.flatMap { it.cities }.map { it.name }.toHashSet()
|
||||||
name = civInfo.getCivilization().cities.first { !allExistingCityNames.contains(it) }
|
name = civInfo.getCivilization().cities.first { !allExistingCityNames.contains(it) }
|
||||||
|
|
||||||
this.location = cityLocation
|
this.location = cityLocation
|
||||||
civInfo.cities.add(this)
|
civInfo.cities.add(this)
|
||||||
if(civInfo == civInfo.gameInfo.getPlayerCivilization())
|
if(civInfo == civInfo.gameInfo.getPlayerCivilization())
|
||||||
@ -135,7 +136,7 @@ class CityInfo {
|
|||||||
|
|
||||||
|
|
||||||
internal fun getMaxHealth(): Int {
|
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
|
override fun toString(): String {return name} // for debug
|
||||||
|
@ -27,7 +27,7 @@ class CivStatsTable(val screen: WorldScreen) : Table() {
|
|||||||
background = civBackground.tint(Color(0x004085e0))
|
background = civBackground.tint(Color(0x004085e0))
|
||||||
|
|
||||||
val resourceTable = Table()
|
val resourceTable = Table()
|
||||||
resourceTable.defaults().pad(10f)
|
resourceTable.defaults().pad(5f)
|
||||||
val revealedStrategicResources = GameBasics.TileResources.values
|
val revealedStrategicResources = GameBasics.TileResources.values
|
||||||
.filter { it.resourceType== ResourceType.Strategic} // && civInfo.tech.isResearched(it.revealedBy!!) }
|
.filter { it.resourceType== ResourceType.Strategic} // && civInfo.tech.isResearched(it.revealedBy!!) }
|
||||||
for(resource in revealedStrategicResources){
|
for(resource in revealedStrategicResources){
|
||||||
|
Reference in New Issue
Block a user