Resolved #9340 - fixed 'enhance religion' crash

This commit is contained in:
Yair Morgenstern 2023-05-08 18:02:11 +03:00
parent ade3af7729
commit ea64f941a6

View File

@ -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())
}
}