mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-15 18:28:42 +07:00
AI no longer tries to attack with carriers, crashing the game.
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user