Invisible submarines are excluded from notification.

This commit is contained in:
Duan Tao
2019-09-18 10:53:41 +08:00
committed by Yair Morgenstern
parent b86d11b5fa
commit 0adeb68ea6

View File

@ -103,12 +103,13 @@ class GameInfo {
currentPlayerCiv = getCivilization(currentPlayer)
// Start our turn immediately before the player can made decisions - affects whether our units can commit automated actions and then be attacked immediately etc.
val viewableInvisibleTiles = thisPlayer.viewableInvisibleUnitsTiles.map { it.position }
val enemyUnitsCloseToTerritory = thisPlayer.viewableTiles
.filter {
it.militaryUnit != null && it.militaryUnit!!.civInfo != thisPlayer
&& thisPlayer.isAtWarWith(it.militaryUnit!!.civInfo)
&& (it.getOwner() == thisPlayer || it.neighbors.any { neighbor -> neighbor.getOwner() == thisPlayer })
&& (it.getOwner() == thisPlayer || it.neighbors.any { neighbor -> neighbor.getOwner() == thisPlayer }
&& (!it.militaryUnit!!.isInvisible() || viewableInvisibleTiles.contains(it.position)))
}
// enemy units ON our territory