From c5f2a744940dbc685b25373fa2dabb548f0b26fa Mon Sep 17 00:00:00 2001 From: Hyper_ <40342021+NotHyper-474@users.noreply.github.com> Date: Wed, 26 Mar 2025 20:34:30 -0300 Subject: [PATCH] fix: Prevent loading invalid variation --- .../charting/handlers/ChartEditorImportExportHandler.hx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorImportExportHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorImportExportHandler.hx index dae5e9db2..1db4a2481 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorImportExportHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorImportExportHandler.hx @@ -119,6 +119,11 @@ class ChartEditorImportExportHandler state.songChartData = newSongChartData; state.selectedDifficulty = state.availableDifficulties[0]; + if (!newSongMetadata.exists(state.selectedVariation)) + { + state.selectedVariation = Constants.DEFAULT_VARIATION; + } + Conductor.instance.forceBPM(null); // Disable the forced BPM. Conductor.instance.instrumentalOffset = state.currentInstrumentalOffset; // Loads from the metadata. Conductor.instance.mapTimeChanges(state.currentSongMetadata.timeChanges);