Resolved #11956 - Fixed Workboat construction automation ignoring existing workboat in city

This commit is contained in:
yairm210 2024-07-14 09:40:38 +03:00
parent 6a8718746d
commit 4cedc38668

View File

@ -203,7 +203,7 @@ class ConstructionAutomation(val cityConstructions: CityConstructions) {
// todo Still ignores whether that boat can reach the not-yet-found tile to improve
val twoTurnsMovement = buildableWorkboatUnits.maxOf { it.movement } * 2
fun MapUnit.isOurWorkBoat() = cache.hasUniqueToCreateWaterImprovements && this.civ == this@ConstructionAutomation.civInfo
val alreadyHasWorkBoat = city.getCenterTile().getTilesInDistanceRange(1..twoTurnsMovement)
val alreadyHasWorkBoat = city.getCenterTile().getTilesInDistance(twoTurnsMovement)
.any { it.civilianUnit?.isOurWorkBoat() == true }
if (alreadyHasWorkBoat) return