mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 03:53:12 -04:00
Fixed softlock forcing you to found a pantheon without available beliefs (#7883)
This commit is contained in:
parent
bf275cc1c4
commit
364da94e5d
@ -206,7 +206,8 @@ class ReligionManager : IsPartOfGameInfoSerialization {
|
|||||||
val gameInfo = civInfo.gameInfo
|
val gameInfo = civInfo.gameInfo
|
||||||
val numberOfBeliefs = if (type == BeliefType.Any) gameInfo.ruleSet.beliefs.values.count()
|
val numberOfBeliefs = if (type == BeliefType.Any) gameInfo.ruleSet.beliefs.values.count()
|
||||||
else gameInfo.ruleSet.beliefs.values.count { it.type == type }
|
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? {
|
fun getReligionWithBelief(belief: Belief): Religion? {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user