From cd0edc837840fb4d94fba1ade90b180f69808d7d Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Mon, 19 Dec 2022 13:12:22 +0100 Subject: [PATCH] GRAY ITS WORKING NOW --- source/funkin/game/PlayState.hx | 2 +- source/funkin/system/Conductor.hx | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 4ab0c1f5..87c4757d 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -516,7 +516,7 @@ class PlayState extends MusicBeatState FlxG.sound.music = inst; FlxG.sound.music.play(); } - FlxG.sound.music.onComplete = endSong; + inst.onComplete = endSong; vocals.play(); updateDiscordStatus(); diff --git a/source/funkin/system/Conductor.hx b/source/funkin/system/Conductor.hx index 9dc9bf61..ed420b9a 100644 --- a/source/funkin/system/Conductor.hx +++ b/source/funkin/system/Conductor.hx @@ -105,11 +105,12 @@ class Conductor var curBPM:Float = song.bpm; var totalSteps:Int = 0; var totalPos:Float = 0; - for (i in 0...song.notes.length) + for (i=>notes in song.notes) { - if(song.notes[i].changeBPM && song.notes[i].bpm != curBPM) + if (notes == null) continue; + if (notes.changeBPM && notes.bpm != curBPM) { - curBPM = song.notes[i].bpm; + curBPM = notes.bpm; var event:BPMChangeEvent = { stepTime: totalSteps, songTime: totalPos, @@ -118,7 +119,7 @@ class Conductor bpmChangeMap.push(event); } - var deltaSteps:Int = song.notes[i].lengthInSteps; + var deltaSteps:Int = notes.lengthInSteps; totalSteps += deltaSteps; totalPos += ((60 / curBPM) * 1000 / 4) * deltaSteps; }