Encampments revealed by ruins effects have lastSeenImprovement updated (#5631)

This commit is contained in:
SimonCeder 2021-11-02 23:14:32 +01:00 committed by GitHub
parent 8f216b3662
commit 118f11abb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 7 deletions

View File

@ -98,7 +98,6 @@ class CivInfoTransientUpdater(val civInfo: CivilizationInfo) {
if (civInfo.playerType == PlayerType.AI) return // don't bother for AI, they don't really use the info anyway
for (tile in civInfo.viewableTiles) {
val before = civInfo.lastSeenImprovement[tile.position]
if (tile.improvement == null)
civInfo.lastSeenImprovement.remove(tile.position)
else

View File

@ -401,12 +401,19 @@ object UniqueTriggerActivation {
}
.map { it.position }
if (nearbyRevealableTiles.none()) return false
civInfo.exploredTiles.addAll(nearbyRevealableTiles
.shuffled(tileBasedRandom)
.apply {
if (unique.params[0] != "All") this.take(unique.params[0].toInt())
}
)
val revealedTiles = nearbyRevealableTiles
.shuffled(tileBasedRandom)
.apply {
if (unique.params[0] != "All") this.take(unique.params[0].toInt())
}
for (position in revealedTiles) {
civInfo.exploredTiles.add(position)
val revealedTileInfo = civInfo.gameInfo.tileMap[position]
if (revealedTileInfo.improvement == null)
civInfo.lastSeenImprovement.remove(position)
else
civInfo.lastSeenImprovement[position] = revealedTileInfo.improvement!!
}
if (notification != null) {
civInfo.addNotification(