AI only builds work boats for water resources whose improvement can actually be constructed

This commit is contained in:
Yair Morgenstern 2022-02-17 23:39:49 +02:00
parent c41410812a
commit a38034ed91

View File

@ -154,7 +154,10 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
}
for (i in 1..10) bfs.nextStep()
if (!bfs.getReachedTiles()
.any { it.hasViewableResource(civInfo) && it.improvement == null && it.getOwner() == civInfo }
.any { it.hasViewableResource(civInfo) && it.improvement == null && it.getOwner() == civInfo
&& it.tileResource.improvement != null
&& it.canBuildImprovement(it.ruleset.tileImprovements[it.tileResource.improvement]!!, civInfo)
}
) return
addChoice(