mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-08 23:08:35 +07:00
Added exception to catch the situation causing #11404
This commit is contained in:
@ -207,6 +207,11 @@ class UniqueValidator(val ruleset: Ruleset) {
|
|||||||
if (unique.type == null) return emptyList()
|
if (unique.type == null) return emptyList()
|
||||||
val errorList = ArrayList<UniqueComplianceError>()
|
val errorList = ArrayList<UniqueComplianceError>()
|
||||||
for ((index, param) in unique.params.withIndex()) {
|
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 acceptableParamTypes = unique.type.parameterTypeMap[index]
|
||||||
val errorTypesForAcceptableParameters =
|
val errorTypesForAcceptableParameters =
|
||||||
acceptableParamTypes.map { getParamTypeErrorSeverityCached(it, param) }
|
acceptableParamTypes.map { getParamTypeErrorSeverityCached(it, param) }
|
||||||
|
Reference in New Issue
Block a user