AI no longer tries to attack with carriers, crashing the game.

This commit is contained in:
Yair Morgenstern
2021-03-28 21:59:29 +03:00
parent 24c0be2950
commit 1f057831d8

View File

@ -13,6 +13,7 @@ import com.unciv.models.AttackableTile
object BattleHelper {
fun tryAttackNearbyEnemy(unit: MapUnit): Boolean {
if (unit.hasUnique("Cannot attack")) return false
val attackableEnemies = getAttackableEnemies(unit, unit.movement.getDistanceToTiles())
// Only take enemies we can fight without dying
.filter {