diff --git a/core/src/com/unciv/logic/automation/WorkerAutomation.kt b/core/src/com/unciv/logic/automation/WorkerAutomation.kt index ddc4e0f78c..8b1df35141 100644 --- a/core/src/com/unciv/logic/automation/WorkerAutomation.kt +++ b/core/src/com/unciv/logic/automation/WorkerAutomation.kt @@ -25,8 +25,8 @@ class WorkerAutomation(val unit: MapUnit) { } if (tileToWork != tile) { - unit.movementAlgs().headTowards(tileToWork) - unit.doPreTurnAction() + val reachedTile = unit.movementAlgs().headTowards(tileToWork) + if(reachedTile!=tile) unit.doPreTurnAction() // otherwise, we get a situation where the worker is automated, so it tries to move but doesn't, then tries to automate, then move, etc, forever. Stack overflow exception! return } if (tile.improvementInProgress == null) {