diff --git a/core/src/com/unciv/logic/automation/UnitAutomation.kt b/core/src/com/unciv/logic/automation/UnitAutomation.kt index 995b81bc30..d20a2ce68a 100644 --- a/core/src/com/unciv/logic/automation/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/UnitAutomation.kt @@ -199,7 +199,7 @@ class UnitAutomation{ for(reachableTile in tilesToAttackFrom){ // tiles we'll still have energy after we reach there val tilesInAttackRange = - if (unit.hasUnique("Indirect Fire")) reachableTile.getTilesInDistance(rangeOfAttack) + if (unit.hasUnique("Indirect Fire") || unit.type.isAirUnit()) reachableTile.getTilesInDistance(rangeOfAttack) else reachableTile.getViewableTiles(rangeOfAttack, unit.type.isWaterUnit()) attackableTiles += tilesInAttackRange.asSequence().filter { it in tilesWithEnemies } diff --git a/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt b/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt index 8f23a5ef58..dc0d0bd248 100644 --- a/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt +++ b/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt @@ -295,11 +295,12 @@ class TileMapHolder(internal val worldScreen: WorldScreen, internal val tileMap: if (UnCivGame.Current.settings.singleTapMove || isAirUnit) 0.7f else 0.3f) val unitType = unit.type - val attackableTiles: List = when { - unitType.isCivilian() -> listOf() - else -> UnitAutomation().getAttackableEnemies(unit, unit.getDistanceToTiles()).map { it.tileToAttack } - .filter { (UnCivGame.Current.viewEntireMapForDebug || playerViewableTilePositions.contains(it.position)) } + val attackableTiles: List = if (unitType.isCivilian()) listOf() + else { + val tiles = UnitAutomation().getAttackableEnemies(unit, unit.getDistanceToTiles()).map { it.tileToAttack } + tiles.filter { (UnCivGame.Current.viewEntireMapForDebug || playerViewableTilePositions.contains(it.position)) } } + for (attackableTile in attackableTiles) { tileGroups[attackableTile]!!.showCircle(colorFromRGB(237, 41, 57)) tileGroups[attackableTile]!!.showCrosshair()