diff --git a/core/src/com/unciv/Constants.kt b/core/src/com/unciv/Constants.kt index c2f414bd02..adbd0a440f 100644 --- a/core/src/com/unciv/Constants.kt +++ b/core/src/com/unciv/Constants.kt @@ -47,6 +47,9 @@ object Constants { const val random = "Random" val greatImprovements = listOf("Academy", "Landmark", "Manufactory", "Customs house", "Citadel") + const val fort = "Fort" + const val citadel = "Citadel" + const val unitActionSetUp = "Set Up" const val unitActionSleep = "Sleep" const val unitActionSleepUntilHealed = "Sleep until healed" diff --git a/core/src/com/unciv/logic/automation/WorkerAutomation.kt b/core/src/com/unciv/logic/automation/WorkerAutomation.kt index 546e73e50d..31d44c593a 100644 --- a/core/src/com/unciv/logic/automation/WorkerAutomation.kt +++ b/core/src/com/unciv/logic/automation/WorkerAutomation.kt @@ -194,7 +194,8 @@ class WorkerAutomation(val unit: MapUnit) { tile.containsUnfinishedGreatImprovement() -> null // Defence is more important that civilian improvements - evaluateFortPlacement(tile,civInfo) -> "Fort" + // While AI sucks in strategical placement of forts, allow a human does it manually + !civInfo.isPlayerCivilization() && evaluateFortPlacement(tile,civInfo) -> Constants.fort // I think we can assume that the unique improvement is better uniqueImprovement!=null && tile.canBuildImprovement(uniqueImprovement,civInfo) -> uniqueImprovement.name @@ -228,7 +229,7 @@ class WorkerAutomation(val unit: MapUnit) { // don't build fort in the city if (tile.isCityCenter()) return false // don't build fort if it is already here - if (tile.improvement == "Fort") return false + if (tile.improvement == Constants.fort) return false // don't build on resource tiles if (tile.hasViewableResource(civInfo)) return false // don't build on great improvements @@ -249,8 +250,8 @@ class WorkerAutomation(val unit: MapUnit) { // don't build forts too close to the cities if (closeTile.isCityCenter()) return false // don't build forts too close to other forts - if (closeTile.improvement == "Fort" || closeTile.improvement == "Citadel" - || closeTile.improvementInProgress == "Fort") return false + if (closeTile.improvement == Constants.fort || closeTile.improvement == Constants.citadel + || closeTile.improvementInProgress == Constants.fort) return false // there is another better tile for the fort if (!isHills && tile.getBaseTerrain().name == Constants.hill && isAcceptableTileForFort(closeTile, civInfo)) return false