From e02038d4bf733a82df153ac768d6c926a4d6bdd6 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sat, 28 Dec 2019 21:15:57 +0200 Subject: [PATCH] Fixed crashing bug from trying to move the the enemy unit instead of to the place to attack from --- android/build.gradle | 4 ++-- core/src/com/unciv/logic/automation/UnitAutomation.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index fa99dde4bd..c07e7ec60a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 29 - versionCode 354 - versionName "3.4.5" + versionCode 355 + versionName "3.4.5-patch1" archivesBaseName = "Unciv" } diff --git a/core/src/com/unciv/logic/automation/UnitAutomation.kt b/core/src/com/unciv/logic/automation/UnitAutomation.kt index a12cdf3536..876511c628 100644 --- a/core/src/com/unciv/logic/automation/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/UnitAutomation.kt @@ -273,7 +273,7 @@ class UnitAutomation{ val closestEnemy = closeEnemies.minBy { it.tileToAttack.arialDistanceTo(unit.getTile()) } if (closestEnemy != null) { - unit.movement.headTowards(closestEnemy.tileToAttack) + unit.movement.headTowards(closestEnemy.tileToAttackFrom) return true } return false