Fixed crash when AI is picking religions (#5421)

This commit is contained in:
Xander Lenstra 2021-10-07 20:24:17 +02:00 committed by GitHub
parent d25adacec7
commit 10a00eed3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,6 +53,9 @@ class Religion() : INamed {
}
fun getBeliefs(beliefType: BeliefType): Sequence<Belief> {
if (beliefType == BeliefType.Any)
return mapToExistingBeliefs((founderBeliefs + followerBeliefs).toHashSet()).asSequence()
val beliefs =
when (beliefType) {
BeliefType.Pantheon -> followerBeliefs