mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-03 12:54:43 +07:00
Resolved #11481 - Safeguard against uniques specifying non-existant promotions
This commit is contained in:
parent
82c478a4dd
commit
5b73fcd419
@ -64,7 +64,7 @@ class UnitPromotions : IsPartOfGameInfoSerialization {
|
||||
|
||||
fun addPromotion(promotionName: String, isFree: Boolean = false) {
|
||||
val ruleset = unit.civ.gameInfo.ruleset
|
||||
val promotion = ruleset.unitPromotions[promotionName]!!
|
||||
val promotion = ruleset.unitPromotions[promotionName] ?: return
|
||||
|
||||
if (!isFree) {
|
||||
if (!promotion.hasUnique(UniqueType.FreePromotion)) {
|
||||
|
Loading…
Reference in New Issue
Block a user