mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 13:18:56 +07:00
Minor bugfix
This commit is contained in:
@ -146,6 +146,8 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
||||
}
|
||||
} else { // If the tile is far away, we need to build a path how to get there, and then take the first step
|
||||
val path = getShortestPath(destination)
|
||||
class UnreachableDestinationException:Exception()
|
||||
if(path.isEmpty()) throw UnreachableDestinationException()
|
||||
destinationTileThisTurn = path.first()
|
||||
}
|
||||
|
||||
|
@ -61,9 +61,11 @@ class TileMapHolder(internal val worldScreen: WorldScreen, internal val tileMap:
|
||||
|
||||
if(selectedUnit.currentMovement>0)
|
||||
moveHereGroup.onClick {
|
||||
if(selectedUnit.movementAlgs().canReach(tileInfo)) {
|
||||
selectedUnit.movementAlgs().headTowards(tileInfo)
|
||||
if(selectedUnit.currentTile != tileInfo)
|
||||
if (selectedUnit.currentTile != tileInfo)
|
||||
selectedUnit.action = "moveTo " + tileInfo.position.x.toInt() + "," + tileInfo.position.y.toInt()
|
||||
}
|
||||
|
||||
worldScreen.update()
|
||||
overlayActor!!.remove()
|
||||
|
Reference in New Issue
Block a user