mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 03:53:12 -04:00
Resolved #13043 - Remove great person point accumulation for units no longer available in this ruleset
This commit is contained in:
parent
9317e896e9
commit
78f6c8c602
@ -27,6 +27,7 @@ object BackwardCompatibility {
|
||||
tileMap.removeMissingTerrainModReferences(ruleset)
|
||||
|
||||
removeUnitsAndPromotions()
|
||||
removeMissingGreatPersonPoints()
|
||||
|
||||
// Mod decided you can't repair things anymore - get rid of old pillaged improvements
|
||||
removeOldPillagedImprovements()
|
||||
@ -57,6 +58,18 @@ object BackwardCompatibility {
|
||||
}
|
||||
}
|
||||
|
||||
private fun GameInfo.removeMissingGreatPersonPoints() {
|
||||
for (civ in civilizations) {
|
||||
// Don't remove the 'points to next' counters, since pools do not necessarily correspond to unit names
|
||||
for (key in civ.greatPeople.greatGeneralPointsCounter.keys.toList())
|
||||
if (!ruleset.units.containsKey(key))
|
||||
civ.greatPeople.greatGeneralPointsCounter.remove(key)
|
||||
for (key in civ.greatPeople.greatPersonPointsCounter.keys.toList())
|
||||
if (!ruleset.units.containsKey(key))
|
||||
civ.greatPeople.greatPersonPointsCounter.remove(key)
|
||||
}
|
||||
}
|
||||
|
||||
private fun GameInfo.removeOldPillagedImprovements() {
|
||||
if (!ruleset.tileImprovements.containsKey(Constants.repair))
|
||||
for (tile in tileMap.values) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user