Fixed a bug where every improvement pretended to be a citadel (#5563)

This commit is contained in:
Xander Lenstra 2021-10-26 07:31:39 +02:00 committed by GitHub
parent cbfbec166b
commit b2557de5d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1015,7 +1015,10 @@ class MapUnit {
// Check for Citadel damage - note: 'Damage does not stack with other Citadels'
val citadelTile = currentTile.neighbors
.filter {
it.getOwner() != null && civInfo.isAtWarWith(it.getOwner()!!) && it.improvement != null
it.getOwner() != null
&& it.improvement != null
&& civInfo.isAtWarWith(it.getOwner()!!)
&& it.getTileImprovement()!!.hasUnique(UniqueType.DamagesAdjacentEnemyUnits)
}.maxByOrNull { tile ->
tile.getTileImprovement()!!
.getMatchingUniques(UniqueType.DamagesAdjacentEnemyUnits)