Resolved #836 - bug where ranged units could shoot above forests+jungles

This commit is contained in:
Yair Morgenstern 2019-06-03 20:50:58 +03:00
parent 6f29fe9e76
commit f49662b22e
2 changed files with 4 additions and 3 deletions

View File

@ -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) }

View File

@ -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
}