mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08: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"
|
applicationId "com.unciv.app"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 354
|
versionCode 355
|
||||||
versionName "3.4.5"
|
versionName "3.4.5-patch1"
|
||||||
|
|
||||||
archivesBaseName = "Unciv"
|
archivesBaseName = "Unciv"
|
||||||
}
|
}
|
||||||
|
@ -273,7 +273,7 @@ class UnitAutomation{
|
|||||||
val closestEnemy = closeEnemies.minBy { it.tileToAttack.arialDistanceTo(unit.getTile()) }
|
val closestEnemy = closeEnemies.minBy { it.tileToAttack.arialDistanceTo(unit.getTile()) }
|
||||||
|
|
||||||
if (closestEnemy != null) {
|
if (closestEnemy != null) {
|
||||||
unit.movement.headTowards(closestEnemy.tileToAttack)
|
unit.movement.headTowards(closestEnemy.tileToAttackFrom)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
Reference in New Issue
Block a user