mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-27 08:09:21 +07:00
Fixed bug when playing with translations and constructing science, gold or nothing in a city
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 118
|
versionCode 120
|
||||||
versionName "2.7.6"
|
versionName "2.7.7"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
@ -69,6 +69,16 @@ class UnitAutomation{
|
|||||||
// if both failed, then... there aren't any reachable tiles. Which is possible.
|
// 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) {
|
fun healUnit(unit:MapUnit) {
|
||||||
val tilesInDistance = unit.getDistanceToTiles().keys
|
val tilesInDistance = unit.getDistanceToTiles().keys
|
||||||
val unitTile = unit.getTile()
|
val unitTile = unit.getTile()
|
||||||
@ -112,7 +122,6 @@ class UnitAutomation{
|
|||||||
val tilesToAttackFrom = distanceToTiles.filter { unit.currentMovement - it.value > 0.1 }
|
val tilesToAttackFrom = distanceToTiles.filter { unit.currentMovement - it.value > 0.1 }
|
||||||
.map { it.key }
|
.map { it.key }
|
||||||
.filter { unit.canMoveTo(it) || it==unit.getTile() }
|
.filter { unit.canMoveTo(it) || it==unit.getTile() }
|
||||||
|
|
||||||
for(reachableTile in tilesToAttackFrom){ // tiles we'll still have energy after we reach there
|
for(reachableTile in tilesToAttackFrom){ // tiles we'll still have energy after we reach there
|
||||||
val tilesInAttackRange = if (unit.hasUnique("Indirect fire")) reachableTile.getTilesInDistance(rangeOfAttack)
|
val tilesInAttackRange = if (unit.hasUnique("Indirect fire")) reachableTile.getTilesInDistance(rangeOfAttack)
|
||||||
else reachableTile.getViewableTiles(rangeOfAttack)
|
else reachableTile.getViewableTiles(rangeOfAttack)
|
||||||
|
@ -44,14 +44,14 @@ class CityConstructions {
|
|||||||
|
|
||||||
fun getCityProductionTextForCityButton(): String {
|
fun getCityProductionTextForCityButton(): String {
|
||||||
var result = currentConstruction.tr()
|
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()
|
result += "\r\n" + turnsToConstruction(currentConstruction) + " {turns}".tr()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getProductionForTileInfo(): String {
|
fun getProductionForTileInfo(): String {
|
||||||
var result = currentConstruction.tr()
|
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()
|
result += "\r\n{in} ".tr() + turnsToConstruction(currentConstruction) + " {turns}".tr()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
@ -183,6 +183,7 @@ class WorldScreen : CameraStageBaseScreen() {
|
|||||||
catch (ex:Exception){
|
catch (ex:Exception){
|
||||||
UnCivGame.Current.settings.hasCrashedRecently=true
|
UnCivGame.Current.settings.hasCrashedRecently=true
|
||||||
UnCivGame.Current.settings.save()
|
UnCivGame.Current.settings.save()
|
||||||
|
throw ex
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we put this BEFORE the save game, then we try to save the game...
|
// If we put this BEFORE the save game, then we try to save the game...
|
||||||
|
Reference in New Issue
Block a user