From d6a99a7848fdcb413e86b58d3fa3241885d98e3d Mon Sep 17 00:00:00 2001 From: Xander Lenstra <71121390+xlenstra@users.noreply.github.com> Date: Thu, 6 Jan 2022 22:29:59 +0100 Subject: [PATCH] Fixed a bug where great improvements could not be repaired after being pillaged (#5913) * Fixed a bug where great improvements could not be repaired * Formatting --- core/src/com/unciv/logic/map/MapUnit.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index 1f56cc4e8c..99bbbb83af 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -1104,7 +1104,11 @@ class MapUnit { fun canBuildImprovement(improvement: TileImprovement, tile: TileInfo = currentTile): Boolean { // Workers (and similar) should never be able to (instantly) construct things, only build them - if (improvement.turnsToBuild == 0 && improvement.name != Constants.cancelImprovementOrder) return false + // HOWEVER, they should be able to repair such things if they are pillaged + if (improvement.turnsToBuild == 0 + && improvement.name != Constants.cancelImprovementOrder + && tile.improvementInProgress != improvement.name + ) return false val matchingUniques = getMatchingUniques(UniqueType.BuildImprovements) return matchingUniques.any { improvement.matchesFilter(it.params[0]) || tile.matchesTerrainFilter(it.params[0]) } }