diff --git a/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt b/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt index 8b3d5659fa..a438d1a3ee 100644 --- a/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt @@ -164,10 +164,10 @@ object UnitAutomation { (UncivGame.Current.settings.automatedUnitsChoosePromotions || unit.civ.isAI())) { val availablePromotions = unit.promotions.getAvailablePromotions() .filterNot { it.hasUnique(UniqueType.SkipPromotion) } - if (availablePromotions.any()) - unit.promotions.addPromotion( - availablePromotions.filter { it.hasUnique(UniqueType.FreePromotion) }.toList().randomOrNull()?.name - ?: availablePromotions.toList().random().name) + if (availablePromotions.none()) break + unit.promotions.addPromotion( + availablePromotions.filter { it.hasUnique(UniqueType.FreePromotion) }.toList().randomOrNull()?.name + ?: availablePromotions.toList().random().name) } //This allows for military units with certain civilian abilities to behave as civilians in peace and soldiers in war