diff --git a/android/build.gradle b/android/build.gradle index f4c7a94cd2..3e7f8c29dd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.game" minSdkVersion 14 targetSdkVersion 26 - versionCode 118 - versionName "2.7.6" + versionCode 120 + versionName "2.7.7" } buildTypes { release { diff --git a/core/src/com/unciv/logic/automation/UnitAutomation.kt b/core/src/com/unciv/logic/automation/UnitAutomation.kt index 729ab81e02..3b81481ca6 100644 --- a/core/src/com/unciv/logic/automation/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/UnitAutomation.kt @@ -69,6 +69,16 @@ class UnitAutomation{ // if both failed, then... there aren't any reachable tiles. Which is possible. } + fun rankTileForHealing(tileInfo: TileInfo, unit: MapUnit): Int { + val tileOwner = tileInfo.getOwner() + when{ + tileInfo.isCityCenter() -> return 3 + tileOwner!=null && !unit.civInfo.isAtWarWith(tileOwner)-> return 2 + tileOwner==null -> return 1 + else -> return 0 + } + } + fun healUnit(unit:MapUnit) { val tilesInDistance = unit.getDistanceToTiles().keys val unitTile = unit.getTile() @@ -112,7 +122,6 @@ class UnitAutomation{ val tilesToAttackFrom = distanceToTiles.filter { unit.currentMovement - it.value > 0.1 } .map { it.key } .filter { unit.canMoveTo(it) || it==unit.getTile() } - for(reachableTile in tilesToAttackFrom){ // tiles we'll still have energy after we reach there val tilesInAttackRange = if (unit.hasUnique("Indirect fire")) reachableTile.getTilesInDistance(rangeOfAttack) else reachableTile.getViewableTiles(rangeOfAttack) diff --git a/core/src/com/unciv/logic/city/CityConstructions.kt b/core/src/com/unciv/logic/city/CityConstructions.kt index 2688746fe2..bdeac52e5d 100644 --- a/core/src/com/unciv/logic/city/CityConstructions.kt +++ b/core/src/com/unciv/logic/city/CityConstructions.kt @@ -44,14 +44,14 @@ class CityConstructions { fun getCityProductionTextForCityButton(): String { var result = currentConstruction.tr() - if (SpecialConstruction.getSpecialConstructions().none { it.name==result }) + if (SpecialConstruction.getSpecialConstructions().none { it.name==currentConstruction }) result += "\r\n" + turnsToConstruction(currentConstruction) + " {turns}".tr() return result } fun getProductionForTileInfo(): String { var result = currentConstruction.tr() - if (SpecialConstruction.getSpecialConstructions().none { it.name==result }) + if (SpecialConstruction.getSpecialConstructions().none { it.name==currentConstruction }) result += "\r\n{in} ".tr() + turnsToConstruction(currentConstruction) + " {turns}".tr() return result } diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index d0db355f9a..a8a119046c 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -183,6 +183,7 @@ class WorldScreen : CameraStageBaseScreen() { catch (ex:Exception){ UnCivGame.Current.settings.hasCrashedRecently=true UnCivGame.Current.settings.save() + throw ex } // If we put this BEFORE the save game, then we try to save the game...