From 8e88a1545ffb8c8444b417e6dd7b75689cc3fb4a Mon Sep 17 00:00:00 2001 From: NyxieFemboy <132237065+NyxieFemboy@users.noreply.github.com> Date: Tue, 18 Feb 2025 21:38:05 -0500 Subject: [PATCH] fixed chart parsing --- .../funkin/backend/chart/FNFLegacyParser.hx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/source/funkin/backend/chart/FNFLegacyParser.hx b/source/funkin/backend/chart/FNFLegacyParser.hx index 94fa14eb..6bef760e 100644 --- a/source/funkin/backend/chart/FNFLegacyParser.hx +++ b/source/funkin/backend/chart/FNFLegacyParser.hx @@ -51,6 +51,18 @@ class FNFLegacyParser { continue; // Yoshi Engine charts crash fix } + var newBeatsPerMeasure:Float = section.sectionBeats != null ? section.sectionBeats : data.beatsPerMeasure.getDefault(4); // Default to 4 if sectionBeats is null or undefined (oops :3) + + if (newBeatsPerMeasure != beatsPerMeasure) { + beatsPerMeasure = newBeatsPerMeasure; + + result.events.push({ + time: curTime, + name: "Time Signature Change", + params: [newBeatsPerMeasure, 4] + }); + } + if (camFocusedBF != (camFocusedBF = section.mustHitSection)) { result.events.push({ time: curTime, @@ -104,16 +116,6 @@ class FNFLegacyParser { }); } - if (section.sectionBeats != null && section.sectionBeats != beatsPerMeasure) { - beatsPerMeasure = section.sectionBeats != null ? section.sectionBeats : data.beatsPerMeasure.getDefault(4); - - result.events.push({ - time: curTime, - name: "Time Signature Change", - params: [section.sectionBeats, 4] - }); - } - curTime += curCrochet * beatsPerMeasure; } }