diff --git a/core/src/com/unciv/logic/civilization/Civilization.kt b/core/src/com/unciv/logic/civilization/Civilization.kt index 8e7c1d221e..3e8d56a52b 100644 --- a/core/src/com/unciv/logic/civilization/Civilization.kt +++ b/core/src/com/unciv/logic/civilization/Civilization.kt @@ -492,7 +492,12 @@ class Civilization : IsPartOfGameInfoSerialization { return tech.currentTechnology() == null && cities.isNotEmpty() } - fun getEquivalentBuilding(buildingName: String) = getEquivalentBuilding(gameInfo.ruleset.buildings[buildingName]!!) + fun getEquivalentBuilding(buildingName: String): Building { + val building = gameInfo.ruleset.buildings[buildingName] + ?: throw Exception("No building by the name of $buildingName exists!") + return getEquivalentBuilding(building) + } + fun getEquivalentBuilding(baseBuilding: Building): Building { if (baseBuilding.replaces != null) return getEquivalentBuilding(baseBuilding.replaces!!) diff --git a/core/src/com/unciv/models/Religion.kt b/core/src/com/unciv/models/Religion.kt index 718cc8ddd4..21f377e53f 100644 --- a/core/src/com/unciv/models/Religion.kt +++ b/core/src/com/unciv/models/Religion.kt @@ -108,6 +108,6 @@ class Religion() : INamed, IsPartOfGameInfoSerialization { belief.getMatchingUniques(UniqueType.BuyBuildingsWithStat).map { it.params[0] } + belief.getMatchingUniques(UniqueType.BuyBuildingsForAmountStat).map { it.params[0] } + belief.getMatchingUniques(UniqueType.BuyBuildingsIncreasingCost).map { it.params[0] } - }.toList() + }.filter { gameInfo.ruleset.buildings.containsKey(it) }.toList() } }