From 0adeb68ea6bbf605afa138afaa2218b0dba2a9a5 Mon Sep 17 00:00:00 2001 From: Duan Tao Date: Wed, 18 Sep 2019 10:53:41 +0800 Subject: [PATCH] Invisible submarines are excluded from notification. --- core/src/com/unciv/logic/GameInfo.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index 45584dacbc..c5fc76da20 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -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