mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-09 20:29:50 +07:00
Resolved #836 - bug where ranged units could shoot above forests+jungles
This commit is contained in:
parent
6f29fe9e76
commit
f49662b22e
@ -180,8 +180,9 @@ class UnitAutomation{
|
||||
.filter { unit.canMoveTo(it) || it==unit.getTile() }
|
||||
|
||||
for(reachableTile in tilesToAttackFrom){ // tiles we'll still have energy after we reach there
|
||||
val tilesInAttackRange = if (unit.hasUnique("Indirect Fire")) reachableTile.getTilesInDistance(rangeOfAttack)
|
||||
else reachableTile.getViewableTiles(rangeOfAttack, unit.type.isWaterUnit())
|
||||
val tilesInAttackRange =
|
||||
if (unit.hasUnique("Indirect Fire")) reachableTile.getTilesInDistance(rangeOfAttack)
|
||||
else reachableTile.getViewableTiles(rangeOfAttack, unit.type.isWaterUnit())
|
||||
|
||||
attackableTiles += tilesInAttackRange.asSequence().filter { it in tilesWithEnemies }
|
||||
.map { AttackableTile(reachableTile,it) }
|
||||
|
@ -95,7 +95,7 @@ open class TileInfo {
|
||||
fun getHeight(): Int {
|
||||
if (baseTerrain==Constants.mountain) return 4
|
||||
if (baseTerrain == Constants.hill) return 2
|
||||
if (baseTerrain==Constants.forest || baseTerrain==Constants.jungle) return 1
|
||||
if (terrainFeature==Constants.forest || terrainFeature==Constants.jungle) return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user