Replaced units are not shown in tech button even when replacing unique unit is in a different tech

This commit is contained in:
Yair Morgenstern 2020-07-05 19:21:16 +03:00
parent ad89286476
commit 75c6ab8acb

View file

@ -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)