diff --git a/android/build.gradle b/android/build.gradle index d18a3eac88..ea79c4ff88 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 29 - versionCode 338 - versionName "3.3.6" + versionCode 339 + versionName "3.3.7" archivesBaseName = "Unciv" } diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitContextMenu.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitContextMenu.kt index fcaea5c2bc..6aea83b552 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitContextMenu.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitContextMenu.kt @@ -59,8 +59,12 @@ class UnitContextMenu(val tileMapHolder: TileMapHolder, val selectedUnit: MapUni // this can take a long time, because of the unit-to-tile calculation needed, so we put it in a different thread thread { // these are the heavy parts, finding where we want to go - if (!selectedUnit.movement.canReach(targetTile)) return@thread // can't move here - val tileToMoveTo = selectedUnit.movement.getTileToMoveToThisTurn(targetTile) + // 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 + val tileToMoveTo:TileInfo + try{ + tileToMoveTo = selectedUnit.movement.getTileToMoveToThisTurn(targetTile) + }catch (ex:Exception){ return@thread } // can't move here Gdx.app.postRunnable { try {