mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-11 07:47:41 +07:00
Fix AI getting stuck when it can't promote with enough xp (#10089)
* Fix AI getting stuck when it can't promote with enough xp * Reverse the check for promotions * Forgot to remove extra break
This commit is contained in:
parent
19f9cba058
commit
fbb516f90f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user