mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 21:30:20 +07:00
Fixed bug when playing with translations and constructing science, gold or nothing in a city
This commit is contained in:
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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...
|
||||
|
Reference in New Issue
Block a user