From 04adaa9a9e3114016ada28ccf504f22a4bf1d5b1 Mon Sep 17 00:00:00 2001 From: Aikoyori <12034280+Aikoyori@users.noreply.github.com> Date: Fri, 28 May 2021 12:19:33 +0700 Subject: [PATCH] fix note shifting not transferring mustHitSection --- source/ChartingState.hx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 38d2f92..cc206ea 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -1301,7 +1301,7 @@ class ChartingState extends MusicBeatState updateGrid(); } - private function newSection(lengthInSteps:Int = 16):SwagSection + private function newSection(lengthInSteps:Int = 16,mustHitSection:Bool = false):SwagSection { var sec:SwagSection = { lengthInSteps: lengthInSteps, @@ -1321,20 +1321,23 @@ class ChartingState extends MusicBeatState var newSong = []; var millisecadd = (((measure*4)+step/4)*(60000/_song.bpm))+ms; + var totaladdsection = Std.int(millisecadd/60000*4); + trace(millisecadd,totaladdsection); if(millisecadd > 0) { - for(i in 0...Std.int((measure/16+step+(ms/(60000/_song.bpm)*16)))) + for(i in 0...totaladdsection) { newSong.unshift(newSection()); } } for (daSection1 in 0..._song.notes.length) { - newSong.push(newSection()); + newSong.push(newSection(16,_song.notes[daSection1].mustHitSection)); } for (daSection in 0...(_song.notes.length)) { + newSong[daSection+Std.int(Math.max(0,totaladdsection))].mustHitSection = _song.notes[daSection].mustHitSection; //trace("section "+daSection); for(daNote in 0...(_song.notes[daSection].sectionNotes.length)) {