fixed chart parsing

This commit is contained in:
NyxieFemboy
2025-02-18 21:38:05 -05:00
parent 3250cdb436
commit 8e88a1545f
+12 -10
View File
@@ -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;
}
}