Units passed with 'next unit' are not returned to

This commit is contained in:
Yair Morgenstern 2022-12-27 09:26:15 +02:00
parent 859cc829f2
commit fc5b8bc73d
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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(