mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-14 01:39:40 +07:00
Fixed "Unique great person is available from Great Person picker screen" bug
This commit is contained in:
@ -288,11 +288,13 @@ class CivilizationInfo {
|
||||
}
|
||||
|
||||
fun getEquivalentUnit(baseUnitName: String): BaseUnit {
|
||||
val baseUnit = gameInfo.ruleSet.units[baseUnitName]
|
||||
if (baseUnit == null) throw UncivShowableException("Unit $baseUnitName doesn't seem to exist!")
|
||||
if (baseUnit.replaces != null) return getEquivalentUnit(baseUnit.replaces!!) // Equivalent of unique unit is the equivalent of the replaced unit
|
||||
|
||||
for (unit in gameInfo.ruleSet.units.values)
|
||||
if (unit.replaces == baseUnitName && unit.uniqueTo == civName)
|
||||
return unit
|
||||
val baseUnit = gameInfo.ruleSet.units[baseUnitName]
|
||||
if (baseUnit == null) throw UncivShowableException("Unit $baseUnitName doesn't seem to exist!")
|
||||
return baseUnit
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user