Fixed crashing bug from trying to move the the enemy unit instead of to the place to attack from

This commit is contained in:
Yair Morgenstern
2019-12-28 21:15:57 +02:00
parent a34e131baa
commit e02038d4bf
2 changed files with 3 additions and 3 deletions

View File

@ -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"
}

View File

@ -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