updated variable name

This commit is contained in:
Emandac 2025-02-14 12:34:20 +01:00
parent 58c806c184
commit 94b21ca75e
3 changed files with 4 additions and 4 deletions

View File

@ -95,7 +95,7 @@ class City : IsPartOfGameInfoSerialization, INamed {
var unitShouldUseSavedPromotion = HashMap<String, Boolean>()
var cityUnitPromotions = HashMap<String, UnitPromotions>()
var unitToPromotions = HashMap<String, UnitPromotions>()
@delegate:Transient
val neighboringCities: List<City> by lazy {
@ -159,7 +159,7 @@ class City : IsPartOfGameInfoSerialization, INamed {
toReturn.manualSpecialists = manualSpecialists
toReturn.connectedToCapitalStatus = connectedToCapitalStatus
toReturn.unitShouldUseSavedPromotion = unitShouldUseSavedPromotion
toReturn.cityUnitPromotions = cityUnitPromotions
toReturn.unitToPromotions = unitToPromotions
return toReturn
}

View File

@ -469,7 +469,7 @@ class CityConstructions : IsPartOfGameInfoSerialization {
// Check if the player want to rebuild the unit the saved promotion
// and null check.
// and finally check if the current unit has enough XP.
val savedPromotion = city.cityUnitPromotions[unit.baseUnit.name]
val savedPromotion = city.unitToPromotions[unit.baseUnit.name]
if (city.unitShouldUseSavedPromotion[unit.baseUnit.name] == true &&
savedPromotion != null && unit.promotions.XP >= savedPromotion.XP) {

View File

@ -214,7 +214,7 @@ class PromotionPickerScreen private constructor(
if (unitCurrentCity != null) {
// If you are clicked the save unitType promotion, you want the next unitType to have the same promotion.
unitCurrentCity.unitShouldUseSavedPromotion.put(unit.baseUnit.name,true)
unitCurrentCity.cityUnitPromotions.put(unit.baseUnit.name,unit.promotions)
unitCurrentCity.unitToPromotions.put(unit.baseUnit.name,unit.promotions)
}
}
}