diff --git a/core/src/com/unciv/models/ruleset/validation/UniqueValidator.kt b/core/src/com/unciv/models/ruleset/validation/UniqueValidator.kt index e7ec5bb2ee..db63394997 100644 --- a/core/src/com/unciv/models/ruleset/validation/UniqueValidator.kt +++ b/core/src/com/unciv/models/ruleset/validation/UniqueValidator.kt @@ -201,12 +201,17 @@ class UniqueValidator(val ruleset: Ruleset) { } /** Maps uncompliant parameters to their required types */ - private fun getComplianceErrors( + private fun getComplianceErrors( unique: Unique, ): List { if (unique.type == null) return emptyList() val errorList = ArrayList() for ((index, param) in unique.params.withIndex()) { + // Trying to catch the error at #11404 + if (unique.type.parameterTypeMap.size != unique.params.size) { + throw Exception("Unique ${unique.text} has ${unique.params.size} parameters, " + + "but its type ${unique.type} only ${unique.type.parameterTypeMap.size} parameters?!") + } val acceptableParamTypes = unique.type.parameterTypeMap[index] val errorTypesForAcceptableParameters = acceptableParamTypes.map { getParamTypeErrorSeverityCached(it, param) }