From a8a5ae7a890915397cba00da79a9b3937017b68a Mon Sep 17 00:00:00 2001 From: Bitto Date: Thu, 2 Apr 2026 00:27:47 +0100 Subject: [PATCH] Fix game crash and fix(?) == to != (#943) --- 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 420f3227..172a8a5c 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