Fixed two small bugs (#6558)

This commit is contained in:
Xander Lenstra 2022-04-17 17:06:39 +02:00 committed by GitHub
parent 06569e6c5f
commit e11a32bb41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -549,7 +549,8 @@ class CivilizationInfo {
for ((key, value) in giftAmount)
otherCiv.addStat(key, value.toInt())
otherCiv.exploredTiles = otherCiv.exploredTiles.withItem(getCapital().location)
if (cities.isNotEmpty())
otherCiv.exploredTiles = otherCiv.exploredTiles.withItem(getCapital().location)
questManager.justMet(otherCiv) // Include them in war with major pseudo-quest
}

View File

@ -66,11 +66,14 @@ class UnitPromotions {
val ruleset = unit.civInfo.gameInfo.ruleSet
val promotion = ruleset.unitPromotions[promotionName]!!
doDirectPromotionEffects(promotion)
if (!promotion.hasUnique("Doing so will consume this opportunity to choose a Promotion"))
promotions.add(promotionName)
// If we upgrade this unit to its new version, we already need to have this promotion added,
// so this has to go after the `promotions.add(promotionname)` line.
doDirectPromotionEffects(promotion)
unit.updateUniques(ruleset)
// Since some units get promotions upon construction, they will get the addPromotion from the unit.postBuildEvent