diff --git a/common/src/main/kotlin/entity/Interactions.kt b/common/src/main/kotlin/entity/Interactions.kt index d5c975d1163f..d6256a5817a3 100644 --- a/common/src/main/kotlin/entity/Interactions.kt +++ b/common/src/main/kotlin/entity/Interactions.kt @@ -168,8 +168,11 @@ sealed class Choice { override fun serialize(encoder: Encoder, value: Choice<*>) { encoder.encodeStructure(descriptor) { encodeStringElement(descriptor, 0, value.name) - if (value is IntChoice) encodeIntElement(descriptor, 1, value.value) - else encodeStringElement(descriptor, 1, value.value.toString()) + when (value) { + is IntChoice -> encodeIntElement(descriptor, 1, value.value) + is NumberChoice -> encodeDoubleElement(descriptor, 1, value.value) + else -> encodeStringElement(descriptor, 1, value.value.toString()) + } } } }