diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index dc1c1c90f3..022e0a59d6 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -924,6 +924,7 @@ class MapUnit { fun destroy() { val currentPosition = Vector2(getTile().position) civInfo.attacksSinceTurnStart.addAll(attacksSinceTurnStart.asSequence().map { CivilizationInfo.HistoricalAttackMemory(this.name, currentPosition, it) }) + currentMovement = 0f removeFromTile() civInfo.removeUnit(this) civInfo.updateViewableTiles() diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index a2dcd585fd..f08bb88ed8 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -1104,7 +1104,7 @@ open class TileInfo { when { airUnits.contains(mapUnit) -> airUnits.remove(mapUnit) civilianUnit == mapUnit -> civilianUnit = null - else -> militaryUnit = null + militaryUnit == mapUnit -> militaryUnit = null } } diff --git a/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt b/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt index 0561069cf1..04e0ce5bf8 100644 --- a/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt +++ b/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt @@ -417,7 +417,7 @@ class UnitMovementAlgorithms(val unit: MapUnit) { } fun moveToTile(destination: TileInfo, considerZoneOfControl: Boolean = true) { - if (destination == unit.getTile()) return // already here! + if (destination == unit.getTile() || unit.isDestroyed) return // already here (or dead)! if (unit.baseUnit.movesLikeAirUnits()) { // air units move differently from all other units