mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 03:18:18 +07:00
Fix crash at conquest, empty religion icon (#4927)
This commit is contained in:
parent
13365e5ad6
commit
5c51e3d38e
@ -190,13 +190,13 @@ class CityInfoReligionManager {
|
||||
* Should be called whenever a city changes hands, e.g. conquering and trading
|
||||
*/
|
||||
fun removeUnknownPantheons() {
|
||||
for (pressure in pressures) {
|
||||
if (pressure.key == Constants.noReligionName) continue
|
||||
val correspondingReligion = cityInfo.civInfo.gameInfo.religions[pressure.key]!!
|
||||
for (pressure in pressures.keys.toList()) { // Copy the keys because we might modify
|
||||
if (pressure == Constants.noReligionName) continue
|
||||
val correspondingReligion = cityInfo.civInfo.gameInfo.religions[pressure]!!
|
||||
if (correspondingReligion.isPantheon()
|
||||
&& correspondingReligion.foundingCivName != cityInfo.civInfo.civName
|
||||
) {
|
||||
pressures.remove(pressure.key)
|
||||
pressures.remove(pressure)
|
||||
}
|
||||
}
|
||||
updateNumberOfFollowers()
|
||||
|
@ -85,11 +85,12 @@ class CityStatsTable(val cityScreen: CityScreen): Table() {
|
||||
private fun addReligionInfo() {
|
||||
val label = cityInfo.religion.getMajorityReligionName()
|
||||
?: "None"
|
||||
val icon = if (label == "None") "Religion" else label
|
||||
val expanderTab =
|
||||
ExpanderTab(
|
||||
title = "Majority Religion: [$label]",
|
||||
fontSize = 18,
|
||||
icon = ImageGetter.getCircledReligionIcon(label, 30f),
|
||||
icon = ImageGetter.getCircledReligionIcon(icon, 30f),
|
||||
defaultPad = 0f,
|
||||
persistenceID = "CityStatsTable.Religion",
|
||||
startsOutOpened = false,
|
||||
|
Loading…
Reference in New Issue
Block a user