mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-08 14:57:58 +07:00
Fixed crashing bug from trying to move the the enemy unit instead of to the place to attack from
This commit is contained in:
@ -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"
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user