From 1f057831d82e68e503afd43c3c7e0c46b9a39e24 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 28 Mar 2021 21:59:29 +0300 Subject: [PATCH] AI no longer tries to attack with carriers, crashing the game. --- core/src/com/unciv/logic/automation/BattleHelper.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/com/unciv/logic/automation/BattleHelper.kt b/core/src/com/unciv/logic/automation/BattleHelper.kt index 61e0c78fc5..1a470092bf 100644 --- a/core/src/com/unciv/logic/automation/BattleHelper.kt +++ b/core/src/com/unciv/logic/automation/BattleHelper.kt @@ -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 {