From fc5b8bc73d338713655834039b847956d53fc412 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Tue, 27 Dec 2022 09:26:15 +0200 Subject: [PATCH] Units passed with 'next unit' are not returned to --- core/src/com/unciv/logic/map/MapUnit.kt | 1 + core/src/com/unciv/ui/worldscreen/WorldScreen.kt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index 10efa052ef..f9a73b264b 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -174,6 +174,7 @@ class MapUnit : IsPartOfGameInfoSerialization { var attacksThisTurn = 0 var promotions = UnitPromotions() + /** Indicates if unit should be located with 'next unit' action */ var due: Boolean = true var isTransported: Boolean = false var turnsFortified = 0 diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index 58184907fd..5d565107b6 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -47,7 +47,6 @@ import com.unciv.ui.saves.LoadGameScreen import com.unciv.ui.saves.QuickSave import com.unciv.ui.saves.SaveGameScreen import com.unciv.ui.utils.BaseScreen -import com.unciv.ui.utils.Fonts import com.unciv.ui.utils.KeyCharAndCode import com.unciv.ui.utils.extensions.centerX import com.unciv.ui.utils.extensions.darken @@ -641,6 +640,8 @@ class WorldScreen( fun switchToNextUnit() { // Try to select something new if we already have the next pending unit selected. + if (bottomUnitTable.selectedUnit != null) + bottomUnitTable.selectedUnit!!.due = false val nextDueUnit = viewingCiv.cycleThroughDueUnits(bottomUnitTable.selectedUnit) if (nextDueUnit != null) { mapHolder.setCenterPosition(