debug: More details for destination tile when failing to move to a tile

This commit is contained in:
Yair Morgenstern
2023-09-21 14:17:42 +03:00
parent 26bae52508
commit ebfdbb8c4a

View File

@ -654,7 +654,7 @@ class MapUnit : IsPartOfGameInfoSerialization {
fun putInTile(tile: Tile) {
when {
!movement.canMoveTo(tile) ->
throw Exception("Unit $name at $currentTile can't be put in tile ${tile.position}!")
throw Exception("Unit $name of ${civ.civName} at $currentTile can't be put in tile $tile!")
baseUnit.movesLikeAirUnits() -> tile.airUnits.add(this)
isCivilian() -> tile.civilianUnit = this
else -> tile.militaryUnit = this