mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-05 21:11:35 +07:00
Nuke blast simulation no longer shows invisible units. (#9913)
* Nuke blast simulation no longer shows invisible units. * Changed code to look better. * Improved readability.
This commit is contained in:
parent
9889bfcd1d
commit
65f884cb54
@ -695,7 +695,9 @@ class WorldMapHolder(
|
||||
val attackableTiles: List<AttackableTile> =
|
||||
if (nukeBlastRadius >= 0)
|
||||
selectedTile!!.getTilesInDistance(nukeBlastRadius)
|
||||
.filter { it.getFirstUnit() != null }
|
||||
// Should not display invisible submarine units even if the tile is visible.
|
||||
.filter { targetTile -> (targetTile.isVisible(unit.civ) && targetTile.getUnits().any { !it.isInvisible(unit.civ) })
|
||||
|| (targetTile.isCityCenter() && unit.civ.hasExplored(targetTile)) }
|
||||
.map { AttackableTile(unit.getTile(), it, 1f, null) }
|
||||
.toList()
|
||||
else BattleHelper.getAttackableEnemies(unit, unit.movement.getDistanceToTiles())
|
||||
|
Loading…
Reference in New Issue
Block a user