mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 12:48:56 +07:00
Resolved #11959 - Fixed air unit movement on map
This commit is contained in:
@ -283,10 +283,11 @@ class WorldMapHolder(
|
|||||||
// Since this runs in a different thread, even if we check movement.canReach()
|
// Since this runs in a different thread, even if we check movement.canReach()
|
||||||
// then it might change until we get to the getTileToMoveTo, so we just try/catch it
|
// then it might change until we get to the getTileToMoveTo, so we just try/catch it
|
||||||
val tileToMoveTo: Tile
|
val tileToMoveTo: Tile
|
||||||
val pathToTile: List<Tile>?
|
var pathToTile: List<Tile>? = null
|
||||||
try {
|
try {
|
||||||
tileToMoveTo = selectedUnit.movement.getTileToMoveToThisTurn(targetTile)
|
tileToMoveTo = selectedUnit.movement.getTileToMoveToThisTurn(targetTile)
|
||||||
pathToTile = selectedUnit.movement.getDistanceToTiles().getPathToTile(tileToMoveTo)
|
if (!selectedUnit.type.isAirUnit())
|
||||||
|
pathToTile = selectedUnit.movement.getDistanceToTiles().getPathToTile(tileToMoveTo)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
when (ex) {
|
when (ex) {
|
||||||
is UnitMovement.UnreachableDestinationException -> {
|
is UnitMovement.UnreachableDestinationException -> {
|
||||||
@ -321,9 +322,11 @@ class WorldMapHolder(
|
|||||||
|
|
||||||
worldScreen.shouldUpdate = true
|
worldScreen.shouldUpdate = true
|
||||||
|
|
||||||
animateMovement(previousTile, selectedUnit, tileToMoveTo, pathToTile)
|
if (pathToTile != null) {
|
||||||
if (selectedUnit.isEscorting()) {
|
animateMovement(previousTile, selectedUnit, tileToMoveTo, pathToTile)
|
||||||
animateMovement(previousTile, selectedUnit.getOtherEscortUnit()!!, tileToMoveTo, pathToTile)
|
if (selectedUnit.isEscorting()) {
|
||||||
|
animateMovement(previousTile, selectedUnit.getOtherEscortUnit()!!, tileToMoveTo, pathToTile)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedUnits.size > 1) { // We have more tiles to move
|
if (selectedUnits.size > 1) { // We have more tiles to move
|
||||||
|
Reference in New Issue
Block a user