1
0
mirror of https://github.com/yairm210/Unciv.git synced 2025-01-13 00:04:38 +07:00

Resolved - Fixed ruleset-dependant building filter activating *when initializing ruleset*

This commit is contained in:
Yair Morgenstern 2024-03-19 23:52:34 +02:00
parent cf0ea815d4
commit 62ce65ec1a

View File

@ -517,8 +517,9 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
replaces -> true
else -> {
if (uniques.contains(filter)) return true
for (requiredTech: String in requiredTechs())
if (ruleset.technologies[requiredTech]?.matchesFilter(filter) == true) return true
if (::ruleset.isInitialized) // False when loading ruleset and checking buildingsToRemove
for (requiredTech: String in requiredTechs())
if (ruleset.technologies[requiredTech]?.matchesFilter(filter) == true) return true
val stat = Stat.safeValueOf(filter)
return (stat != null && isStatRelated(stat))
}