From ea64f941a62d9c33d13eedb7bc1759f5c49237a8 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 8 May 2023 18:02:11 +0300 Subject: [PATCH] Resolved #9340 - fixed 'enhance religion' crash --- .../ui/screens/pickerscreens/ReligiousBeliefsPickerScreen.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/ui/screens/pickerscreens/ReligiousBeliefsPickerScreen.kt b/core/src/com/unciv/ui/screens/pickerscreens/ReligiousBeliefsPickerScreen.kt index 6263f21b84..986215d26a 100644 --- a/core/src/com/unciv/ui/screens/pickerscreens/ReligiousBeliefsPickerScreen.kt +++ b/core/src/com/unciv/ui/screens/pickerscreens/ReligiousBeliefsPickerScreen.kt @@ -6,6 +6,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.utils.Align import com.unciv.Constants import com.unciv.logic.civilization.Civilization +import com.unciv.logic.civilization.managers.ReligionState import com.unciv.models.Counter import com.unciv.models.Religion import com.unciv.models.ruleset.Belief @@ -75,7 +76,8 @@ class ReligiousBeliefsPickerScreen ( if (pickIconAndName) "Choose a Religion" else "Enhance [${currentReligion.getReligionDisplayName()}]" ) { - civInfo.religionManager.foundReligion(displayName!!, religionName!!) + if (civInfo.religionManager.religionState == ReligionState.FoundingReligion) + civInfo.religionManager.foundReligion(displayName!!, religionName!!) chooseBeliefs(beliefsToChoose.map { it.belief!! }, usingFreeBeliefs()) } }