Fixing workers not repairing tiles with Great improvement when pillaged (#12382)

* Settler settle best tile when not escort and dangerous Tiles instead of running away

Settler unit will now settle on best tile in dangerous Tiles without escort instead of running away.

* Update WorkerAutomation.kt

* Update SpecificUnitAutomation.kt

* Update WorkerAutomation.kt

* Update SpecificUnitAutomation.kt
This commit is contained in:
General_E 2024-10-31 06:26:35 +01:00 committed by GitHub
parent 0e7b9db766
commit d652294ea9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 4 deletions

View File

@ -190,7 +190,6 @@ object SpecificUnitAutomation {
throw Exception("City within distance")
return
}
unit.movement.headTowards(bestCityLocation)
if (unit.getTile() == bestCityLocation && unit.hasMovement())
foundCityAction.action.invoke()

View File

@ -232,7 +232,7 @@ class WorkerAutomation(
if (!tile.hasViewableResource(civInfo) && tile.getTilesInDistance(civInfo.gameInfo.ruleset.modOptions.constants.cityWorkRange)
.none { it.isCityCenter() && it.getCity()?.civ == civInfo }
) return false
if (tile.getTileImprovement()?.hasUnique(UniqueType.AutomatedUnitsWillNotReplace) == true) return false
if (tile.getTileImprovement()?.hasUnique(UniqueType.AutomatedUnitsWillNotReplace) == true && !tile.isPillaged()) return false
return true
}
@ -270,8 +270,6 @@ class WorkerAutomation(
tileRankings[tile] = TileImprovementRank(priority)
return priority + unitSpecificPriority
}
/**
* Calculates the priority building the improvement on the tile
*/