From 315313fd2b3e99a35daac75ea0126d05154a6cb2 Mon Sep 17 00:00:00 2001 From: Bitto Date: Mon, 30 Mar 2026 17:26:05 +0100 Subject: [PATCH] Fix game crash and fix(?) == to != --- source/funkin/editors/charter/CharterSelection.hx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/funkin/editors/charter/CharterSelection.hx b/source/funkin/editors/charter/CharterSelection.hx index 420f322750..172a8a5cd2 100644 --- a/source/funkin/editors/charter/CharterSelection.hx +++ b/source/funkin/editors/charter/CharterSelection.hx @@ -146,11 +146,10 @@ class CharterSelectionScreen extends EditorTreeMenuScreen { var screen = parent.tree.last(); var idx = 0; - while (!(screen.members[idx] is Separator)) idx++; + while (!(screen.members[idx] is Separator || idx >= screen.members.length)) idx++; screen.insert(idx, makeChartOption(name, curSong.variant != null && curSong.variant != "" ? curSong.variant : null, curSong.name)); - // Add to Meta - var metaPath = '$songFolder/meta${curSong.variant != null && curSong.variant == "" ? "-" + curSong.variant : ""}.json'; + var metaPath = '$songFolder/meta${curSong.variant != null && curSong.variant != "" ? "-" + curSong.variant : ""}.json'; CoolUtil.safeSaveFile(metaPath, Chart.makeMetaSaveable(curSong)); } #end