Spectator can now see all invisible units including submarines without fog of war. (#9852)

This commit is contained in:
Oskar Niesen 2023-07-30 09:37:36 -05:00 committed by GitHub
parent 283edd0875
commit df7fd27b94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -383,9 +383,9 @@ class MapUnit : IsPartOfGameInfoSerialization {
}
fun isInvisible(to: Civilization): Boolean {
if (hasUnique(UniqueType.Invisible))
if (hasUnique(UniqueType.Invisible) && !to.isSpectator())
return true
if (hasUnique(UniqueType.InvisibleToNonAdjacent))
if (hasUnique(UniqueType.InvisibleToNonAdjacent) && !to.isSpectator())
return getTile().getTilesInDistance(1).none {
it.getUnits().any { unit -> unit.owner == to.civName }
}