From 10a00eed3a1c8088117c6bacb12b12bb77311d77 Mon Sep 17 00:00:00 2001 From: Xander Lenstra <71121390+xlenstra@users.noreply.github.com> Date: Thu, 7 Oct 2021 20:24:17 +0200 Subject: [PATCH] Fixed crash when AI is picking religions (#5421) --- core/src/com/unciv/models/Religion.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/com/unciv/models/Religion.kt b/core/src/com/unciv/models/Religion.kt index 8561210ba6..4e63a63f40 100644 --- a/core/src/com/unciv/models/Religion.kt +++ b/core/src/com/unciv/models/Religion.kt @@ -53,6 +53,9 @@ class Religion() : INamed { } fun getBeliefs(beliefType: BeliefType): Sequence { + if (beliefType == BeliefType.Any) + return mapToExistingBeliefs((founderBeliefs + followerBeliefs).toHashSet()).asSequence() + val beliefs = when (beliefType) { BeliefType.Pantheon -> followerBeliefs