mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 13:27:22 -04:00
parent
9a29ce8422
commit
a1f7721878
@ -281,14 +281,20 @@ class WorkerAutomation(
|
||||
val city = tile.getCity()
|
||||
if (city == null || city.civInfo != civInfo)
|
||||
return false
|
||||
if (tile.improvement != null && !UncivGame.Current.settings.automatedWorkersReplaceImprovements)
|
||||
return false
|
||||
if (tile.improvement != null && !UncivGame.Current.settings.automatedWorkersReplaceImprovements) {
|
||||
if (unit != null) {
|
||||
if (unit.civInfo.isPlayerCivilization())
|
||||
return false
|
||||
} else if (UncivGame.Current.gameInfo.currentPlayerCiv.isPlayerCivilization())
|
||||
return false
|
||||
}
|
||||
|
||||
if (tile.improvement == null) {
|
||||
if (unit == null) return true
|
||||
if (tile.improvementInProgress != null && unit.canBuildImprovement(tile.getTileImprovementInProgress()!!, tile)) return true
|
||||
val chosenImprovement = chooseImprovement(unit, tile)
|
||||
if (chosenImprovement != null && tile.canBuildImprovement(chosenImprovement, civInfo) && unit.canBuildImprovement(chosenImprovement, tile)) return true
|
||||
|
||||
} else if (!tile.containsGreatImprovement() && tile.hasViewableResource(civInfo)
|
||||
&& tile.getTileResource().improvement != tile.improvement
|
||||
&& (unit == null || chooseImprovement(unit, tile) // if the chosen improvement is not null and buildable
|
||||
|
Loading…
x
Reference in New Issue
Block a user