Fixed softlock forcing you to found a pantheon without available beliefs (#7883)

This commit is contained in:
Xander Lenstra 2022-10-02 14:50:08 +02:00 committed by GitHub
parent bf275cc1c4
commit 364da94e5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -206,7 +206,8 @@ class ReligionManager : IsPartOfGameInfoSerialization {
val gameInfo = civInfo.gameInfo
val numberOfBeliefs = if (type == BeliefType.Any) gameInfo.ruleSet.beliefs.values.count()
else gameInfo.ruleSet.beliefs.values.count { it.type == type }
return numberOfBeliefs - gameInfo.religions.flatMap { it.value.getBeliefs(type) }.count()
return numberOfBeliefs - gameInfo.religions.flatMap { it.value.getBeliefs(type) }.distinct().count()
// We need to do the distinct above, as pantheons and religions founded out of those pantheons might share beliefs
}
fun getReligionWithBelief(belief: Belief): Religion? {