From 9a563ec46b56e4daacd70f301c1d107347e6738f Mon Sep 17 00:00:00 2001 From: lemz Date: Sat, 22 Jun 2024 10:52:26 +0200 Subject: [PATCH] switch seemingly doesnt work --- source/funkin/play/notes/notekind/NoteKind.hx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source/funkin/play/notes/notekind/NoteKind.hx b/source/funkin/play/notes/notekind/NoteKind.hx index a0f759949..f2a44dc8a 100644 --- a/source/funkin/play/notes/notekind/NoteKind.hx +++ b/source/funkin/play/notes/notekind/NoteKind.hx @@ -72,12 +72,13 @@ class NoteKind implements INoteScriptedClass { if (param.name == name) { - switch (param.type) + if (param.type == NoteKindParamType.INT || param.type == NoteKindParamType.FLOAT) { - case NoteKindParamType.INT | NoteKindParamType.FLOAT: - param.data.value = FlxMath.bound(value, param.data.min, param.data.max); - default: - param.data.value = value; + param.data.value = FlxMath.bound(value, param.data.min, param.data.max); + } + else + { + param.data.value = value; } break; @@ -118,11 +119,11 @@ class NoteKind implements INoteScriptedClass */ abstract NoteKindParamType(String) to String { - public static var STRING:String = "String"; + public static final STRING:String = 'String'; - public static var INT:String = "Int"; + public static final INT:String = 'Int'; - public static var FLOAT:String = "Float"; + public static final FLOAT:String = 'Float'; } typedef NoteKindParamData =