From bbd7f68a886ece1733bffd153d86efe92e54b303 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Tue, 17 Sep 2024 20:17:10 +0300 Subject: [PATCH] Resolved #12220 - Changing rulesets in new game screen no longer leads to fake error warnings --- .../com/unciv/models/ruleset/unique/UniqueParameterType.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt index e769fc2360..16ec7d26cf 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt @@ -618,8 +618,8 @@ enum class UniqueParameterType( * - [getErrorSeverity] takes precedence and chooses whether to call this or not. * - This means [getErrorSeverity] or [isKnownValue] ***must*** be overridden or else the UniqueParameterType is never valid. */ - open fun isKnownValue(parameterText: String, ruleset: Ruleset): Boolean = knownValuesCache.getOrPut(ruleset) { getKnownValuesForAutocomplete(ruleset) }.contains(parameterText) - open val knownValuesCache: HashMap> = HashMap() + open fun isKnownValue(parameterText: String, ruleset: Ruleset): Boolean = + getKnownValuesForAutocomplete(ruleset).contains(parameterText) /** This returns the known values *for autocomplete* - * there may be 'known values' not in this set, for example uniques.