From 75c6ab8acb84631ffc53d20b1ce3e0fb2610853a Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 5 Jul 2020 19:21:16 +0300 Subject: [PATCH] Replaced units are not shown in tech button even when replacing unique unit is in a different tech --- core/src/com/unciv/models/ruleset/tech/Technology.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/models/ruleset/tech/Technology.kt b/core/src/com/unciv/models/ruleset/tech/Technology.kt index 5ff254e601..7693e09b94 100644 --- a/core/src/com/unciv/models/ruleset/tech/Technology.kt +++ b/core/src/com/unciv/models/ruleset/tech/Technology.kt @@ -86,7 +86,8 @@ class Technology { it.requiredTech == name && (it.uniqueTo == null || it.uniqueTo == civInfo.civName) } - val replacedUnits = enabledUnits.mapNotNull { it.replaces } + val replacedUnits = civInfo.gameInfo.ruleSet.units.values.filter { it.uniqueTo==civInfo.civName } + .mapNotNull { it.replaces } enabledUnits = enabledUnits.filter { it.name !in replacedUnits } if (!civInfo.gameInfo.gameParameters.nuclearWeaponsEnabled)