diff --git a/core/src/com/unciv/logic/automation/WorkerAutomation.kt b/core/src/com/unciv/logic/automation/WorkerAutomation.kt index 884bc4543a..dd082dc5d7 100644 --- a/core/src/com/unciv/logic/automation/WorkerAutomation.kt +++ b/core/src/com/unciv/logic/automation/WorkerAutomation.kt @@ -158,10 +158,11 @@ class WorkerAutomation(val unit: MapUnit) { if (chosenImprovement != null && tile.canBuildImprovement(chosenImprovement, civInfo)) return true } else if (!tile.containsGreatImprovement() && tile.hasViewableResource(civInfo) && tile.getTileResource().improvement != tile.improvement - && tile.canBuildImprovement(chooseImprovement(tile, civInfo)!!, civInfo)) + && chooseImprovement(tile, civInfo) // if the chosen improvement is not null and buildable + .let { it != null && tile.canBuildImprovement(it, civInfo) }) return true - return false // cou;dn't find anything to construct here + return false // couldn't find anything to construct here } fun getPriority(tileInfo: TileInfo, civInfo: CivilizationInfo): Int {