mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 13:27:22 -04: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:
parent
a34e131baa
commit
e02038d4bf
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user