diff --git a/core/src/com/unciv/ui/screens/overviewscreen/UnitOverviewTable.kt b/core/src/com/unciv/ui/screens/overviewscreen/UnitOverviewTable.kt index b459bd0d97..6b1e9dbde2 100644 --- a/core/src/com/unciv/ui/screens/overviewscreen/UnitOverviewTable.kt +++ b/core/src/com/unciv/ui/screens/overviewscreen/UnitOverviewTable.kt @@ -263,7 +263,8 @@ class UnitOverviewTab( // Upgrade column if (unit.upgrade.canUpgrade()) { val unitAction = UnitActionsUpgrade.getUpgradeAction(unit) - val enable = unitAction?.action != null && viewingPlayer.isCurrentPlayer() + val enable = unitAction?.action != null && viewingPlayer.isCurrentPlayer() && + GUI.isAllowedChangeState() val upgradeIcon = ImageGetter.getUnitIcon(unit.upgrade.getUnitToUpgradeTo().name, if (enable) Color.GREEN else Color.GREEN.darken(0.5f)) if (enable) upgradeIcon.onClick { diff --git a/core/src/com/unciv/ui/screens/worldscreen/WorldMapHolder.kt b/core/src/com/unciv/ui/screens/worldscreen/WorldMapHolder.kt index 7cf1599354..37b860b35c 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/WorldMapHolder.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/WorldMapHolder.kt @@ -206,12 +206,10 @@ class WorldMapHolder( } private fun onTileRightClicked(unit: MapUnit, tile: Tile) { - if (UncivGame.Current.gameInfo!!.getCurrentPlayerCivilization().isSpectator()) { - return - } removeUnitActionOverlay() selectedTile = tile unitMovementPaths.clear() + if (!worldScreen.canChangeState) return // Concurrency might open up a race condition window - if worldScreen.shouldUpdate is on too // early, concurrent code might possibly call worldScreen.render() and then our request will be