mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 23:37:31 +07:00
Fixed crash when selecting certain buildings in the civilopedia (#4819)
(cherry picked from commit 6d04bf424b
)
This commit is contained in:
parent
7cd368d024
commit
421cce0a43
@ -1125,14 +1125,14 @@
|
||||
"culture": 3,
|
||||
"happiness": 1,
|
||||
"specialistSlots": {"Artist": 1},
|
||||
"uniques": ["Unbuildable"]
|
||||
"uniques": ["Unbuildable", "Hidden when religion is disabled"]
|
||||
},
|
||||
{
|
||||
"name": "Monastery",
|
||||
"cost": 0,
|
||||
"culture": 2,
|
||||
"faith": 2,
|
||||
"uniques": ["[+1 Culture, +1 Faith] from [Wine] tiles [in this city]",
|
||||
"uniques": ["[+1 Culture, +1 Faith] from [Wine] tiles [in this city]", "Hidden when religion is disabled",
|
||||
"[+1 Culture, +1 Faith] from [Incense] tiles [in this city]","Unbuildable"]
|
||||
},
|
||||
{
|
||||
@ -1141,7 +1141,7 @@
|
||||
"culture": 2,
|
||||
"faith": 3,
|
||||
"happiness": 1,
|
||||
"uniques": ["Unbuildable"]
|
||||
"uniques": ["Unbuildable", "Hidden when religion is disabled"]
|
||||
},
|
||||
{
|
||||
"name": "Pagoda",
|
||||
@ -1149,6 +1149,6 @@
|
||||
"culture": 2,
|
||||
"faith": 2,
|
||||
"happiness": 2,
|
||||
"uniques": ["Unbuildable"]
|
||||
"uniques": ["Unbuildable", "Hidden when religion is disabled"]
|
||||
},
|
||||
]
|
||||
|
@ -203,7 +203,7 @@ class Building : NamedStats(), INonPerpetualConstruction, ICivilopediaText {
|
||||
override fun canBePurchasedWithStat(cityInfo: CityInfo, stat: Stat, ignoreCityRequirements: Boolean): Boolean {
|
||||
if (stat == Stat.Gold && isAnyWonder()) return false
|
||||
// May buy [buildingFilter] buildings for [amount] [Stat] [cityFilter]
|
||||
if (cityInfo.getMatchingUniques("May buy [] buildings for [] [] []")
|
||||
if (!ignoreCityRequirements && cityInfo.getMatchingUniques("May buy [] buildings for [] [] []")
|
||||
.any { it.params[2] == stat.name && matchesFilter(it.params[0]) && cityInfo.matchesFilter(it.params[3]) }
|
||||
) return true
|
||||
return super.canBePurchasedWithStat(cityInfo, stat, ignoreCityRequirements)
|
||||
|
Loading…
Reference in New Issue
Block a user