From 02f1530c44316e62646f3b87c5e8844a44e21fed Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 11 Mar 2019 20:20:07 +0200 Subject: [PATCH] Fixed translation file --- android/assets/jsons/Translations.json | 2 +- .../unciv/ui/worldscreen/bottombar/BattleTable.kt | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/android/assets/jsons/Translations.json b/android/assets/jsons/Translations.json index 26633f6eb8..fe05a6e8c5 100644 --- a/android/assets/jsons/Translations.json +++ b/android/assets/jsons/Translations.json @@ -8364,7 +8364,7 @@ Italian:"Attacco in massa III" German:"Rudeltaktik III" } - +/ + */ // Civilopedia texts "Basics":{ diff --git a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt index b4dd828c50..fd3085871c 100644 --- a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt +++ b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt @@ -132,25 +132,24 @@ class BattleTable(val worldScreen: WorldScreen): Table() { val attackButton = TextButton(attackText.tr(), skin).apply { color= Color.RED } var attackableEnemy : UnitAutomation.AttackableTile? = null - var canAttack : Boolean = attacker.canAttack() - if (canAttack) { + if (attacker.canAttack()) { if (attacker is MapUnitCombatant) { attacker.unit.getDistanceToTiles() - attackableEnemy = UnitAutomation().getAttackableEnemies(attacker.unit, attacker.unit.getDistanceToTiles()) + attackableEnemy = UnitAutomation() + .getAttackableEnemies(attacker.unit, attacker.unit.getDistanceToTiles()) .firstOrNull{ it.tileToAttack == defender.getTile()} - canAttack = attackableEnemy != null } else if (attacker is CityCombatant) { - canAttack = UnitAutomation().getBombardTargets(attacker.city).contains(defender.getTile()) - if (canAttack) { + val canBombard = UnitAutomation().getBombardTargets(attacker.city).contains(defender.getTile()) + if (canBombard) { attackableEnemy = UnitAutomation.AttackableTile(attacker.getTile(), defender.getTile()) } } } - if(!canAttack) attackButton.disable() + if(attackableEnemy == null) attackButton.disable() else { attackButton.onClick { battle.moveAndAttack(attacker,attackableEnemy!!)