Fixed crash from conquering cities (#4877)

This commit is contained in:
Xander Lenstra 2021-08-16 15:58:53 +02:00 committed by GitHub
parent df31fb2f05
commit 8d49a84f78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -216,7 +216,7 @@ class CityInfoConquestFunctions(val city: CityInfo){
}
}
religion.removeUnknownPantheons()
if (civInfo.gameInfo.hasReligionEnabled()) religion.removeUnknownPantheons()
tryUpdateRoadStatus()
}

View File

@ -171,6 +171,7 @@ class CityInfoReligionManager {
*/
fun removeUnknownPantheons() {
for (pressure in pressures) {
if (pressure.key == Constants.noReligionName) continue
val correspondingReligion = cityInfo.civInfo.gameInfo.religions[pressure.key]!!
if (correspondingReligion.isPantheon()
&& correspondingReligion.foundingCivName != cityInfo.civInfo.civName