From 591805b26ba2ef89a84af6d4e360bd231dd34015 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Tue, 22 Oct 2024 12:41:13 +0300 Subject: [PATCH] Resolved #12308 - Wait action selects next unit --- .../unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt | 3 +-- .../ui/screens/worldscreen/unit/actions/UnitActionsTable.kt | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt b/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt index 84dde7277b..cabe29c52a 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt @@ -381,8 +381,7 @@ object UnitActions { type = UnitActionType.Wait, useFrequency = 65f, // Preferably have this on the first page action = { - unit.due = false - GUI.getWorldScreen().switchToNextUnit() + unit.due = false // Skips to next unit due to worldScreen.switchToNextUnit() in activateAction } )) } diff --git a/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt b/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt index 81cab20c08..13039aaf9f 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt @@ -179,7 +179,8 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table() { // overlay, since the user definitely wants to interact with the new unit. worldScreen.mapHolder.removeUnitActionOverlay() if (!UncivGame.Current.settings.autoUnitCycle) return - if (unit.isDestroyed || unitAction.type.isSkippingToNextUnit && (unit.isMoving() && !unit.hasMovement() || !unit.isMoving())) + if (unit.isDestroyed || + unitAction.type.isSkippingToNextUnit && (!unit.isMoving() || !unit.hasMovement())) worldScreen.switchToNextUnit() else worldScreen.bottomUnitTable.selectedUnitHasChanged = true }