Fixed bug where great prophets could be chosen as free great persons when religion was disabled (#4518)

This commit is contained in:
Xander Lenstra 2021-07-15 09:38:26 +02:00 committed by GitHub
parent 482a1260ca
commit 9efcc4f423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -458,8 +458,12 @@ class CivilizationInfo {
}
fun getGreatPeople() = gameInfo.ruleSet.units.values.asSequence()
.filter { it.isGreatPerson() }.map { getEquivalentUnit(it.name) }.toHashSet()
fun getGreatPeople(): HashSet<BaseUnit> {
val greatPeople = gameInfo.ruleSet.units.values.asSequence()
.filter { it.isGreatPerson() }.map { getEquivalentUnit(it.name) }
return if (!gameInfo.hasReligionEnabled()) greatPeople.filter { !it.uniques.contains("Great Person - [Faith]")}.toHashSet()
else greatPeople.toHashSet()
}
//endregion