From fb1b494470bbf433e6e00eca021bd50b26f52bf1 Mon Sep 17 00:00:00 2001 From: Xander Lenstra <71121390+xlenstra@users.noreply.github.com> Date: Mon, 8 Nov 2021 21:50:43 +0100 Subject: [PATCH] It's probably a good idea to actually convert Hanse's to Banks rather than remove them entirely, actually (#5650) * It's probably a good idea to actually convert Hanse's to Banks rather than remove them entirely, actually * Remove checks for the unique as well * Might as well use the intended function for it too --- core/src/com/unciv/logic/BackwardCompatibility.kt | 8 ++++++-- core/src/com/unciv/models/ruleset/Building.kt | 3 --- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/src/com/unciv/logic/BackwardCompatibility.kt b/core/src/com/unciv/logic/BackwardCompatibility.kt index a3dfbf09ed..d563aff828 100644 --- a/core/src/com/unciv/logic/BackwardCompatibility.kt +++ b/core/src/com/unciv/logic/BackwardCompatibility.kt @@ -41,9 +41,13 @@ object BackwardCompatibility { for (city in civilizations.asSequence().flatMap { it.cities.asSequence() }) { - for (building in city.cityConstructions.builtBuildings.toHashSet()) + changeBuildingNameIfNotInRuleset(ruleSet, city.cityConstructions, "Hanse", "Bank") + + for (building in city.cityConstructions.builtBuildings.toHashSet()) { + if (!ruleSet.buildings.containsKey(building)) city.cityConstructions.builtBuildings.remove(building) + } fun isInvalidConstruction(construction: String) = !ruleSet.buildings.containsKey(construction) @@ -67,7 +71,7 @@ object BackwardCompatibility { civInfo.tech.techsResearched.remove(tech) for (policy in civInfo.policies.adoptedPolicies.toList()) if (!ruleSet.policies.containsKey(policy) - // Converstion code for deprecated policies since 3.16.15 + // Conversion code for deprecated policies since 3.16.15 && !(policy == "Patronage " || policy == "Patronage Complete") // ) diff --git a/core/src/com/unciv/models/ruleset/Building.kt b/core/src/com/unciv/models/ruleset/Building.kt index 7bf039b5be..59b01a0a2d 100644 --- a/core/src/com/unciv/models/ruleset/Building.kt +++ b/core/src/com/unciv/models/ruleset/Building.kt @@ -190,9 +190,6 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction { stats.add(Stat.valueOf(unique.params[1]), unique.params[0].toFloat()) } - if (uniques.contains("+5% Production for every Trade Route with a City-State in the empire")) - stats.production += 5 * civInfo.citiesConnectedToCapitalToMediums.count { it.key.civInfo.isCityState() } - return stats }