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