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