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