mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 20:59:18 +07:00
Resolved #11959 - Fixed air unit movement on map
This commit is contained in:
@ -283,9 +283,10 @@ 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)
|
||||||
|
if (!selectedUnit.type.isAirUnit())
|
||||||
pathToTile = selectedUnit.movement.getDistanceToTiles().getPathToTile(tileToMoveTo)
|
pathToTile = selectedUnit.movement.getDistanceToTiles().getPathToTile(tileToMoveTo)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
when (ex) {
|
when (ex) {
|
||||||
@ -321,10 +322,12 @@ class WorldMapHolder(
|
|||||||
|
|
||||||
worldScreen.shouldUpdate = true
|
worldScreen.shouldUpdate = true
|
||||||
|
|
||||||
|
if (pathToTile != null) {
|
||||||
animateMovement(previousTile, selectedUnit, tileToMoveTo, pathToTile)
|
animateMovement(previousTile, selectedUnit, tileToMoveTo, pathToTile)
|
||||||
if (selectedUnit.isEscorting()) {
|
if (selectedUnit.isEscorting()) {
|
||||||
animateMovement(previousTile, selectedUnit.getOtherEscortUnit()!!, tileToMoveTo, pathToTile)
|
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
|
||||||
moveUnitToTargetTile(selectedUnits.subList(1, selectedUnits.size), targetTile)
|
moveUnitToTargetTile(selectedUnits.subList(1, selectedUnits.size), targetTile)
|
||||||
|
Reference in New Issue
Block a user