mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-07 14:02:48 +07:00
Fixed bug where if 2 tiles were of same "ranking", the worker would try and switch back and forth between them.
This commit is contained in:
parent
9816cd57da
commit
6fcf9ec93e
@ -36,7 +36,7 @@ public class WorkerAutomation(){
|
||||
.getShortestPath(currentTile.position, it.position, 2f, 2, civInfo).isNotEmpty()
|
||||
}
|
||||
.maxBy { getPriority(it, civInfo) }
|
||||
if (selectedTile != null && getPriority(selectedTile, civInfo) > 1) return selectedTile
|
||||
if (selectedTile != null && getPriority(selectedTile, civInfo) > getPriority(currentTile,civInfo)) return selectedTile
|
||||
else return currentTile
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.unciv.ui.worldscreen.unit
|
||||
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
|
||||
import com.unciv.UnCivGame
|
||||
import com.unciv.logic.Automation
|
||||
import com.unciv.logic.WorkerAutomation
|
||||
import com.unciv.logic.map.MapUnit
|
||||
import com.unciv.logic.map.TileInfo
|
||||
import com.unciv.models.gamebasics.Building
|
||||
@ -86,7 +86,7 @@ class UnitActions {
|
||||
actionList += UnitAction("Automate",
|
||||
{
|
||||
tile.unit!!.action = "automation"
|
||||
Automation().automateWorkerAction(tile.unit!!)
|
||||
WorkerAutomation().automateWorkerAction(tile.unit!!)
|
||||
},unit.currentMovement != 0f
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user