From 2f763df9a8f3ceabcd127144c326f970cccf4ddd Mon Sep 17 00:00:00 2001 From: Gede Hari Date: Thu, 10 Dec 2020 13:41:31 +0800 Subject: [PATCH] Fixed song still playing when paused right when song starts This should be it. --- source/PlayState.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 8240a064c..f48db0d72 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -378,11 +378,13 @@ class PlayState extends MusicBeatState function startSong():Void { + startingSong = false; + previousFrameTime = FlxG.game.ticks; lastReportedPlayheadPosition = 0; - startingSong = false; - FlxG.sound.playMusic("assets/music/" + SONG.song + "_Inst" + TitleState.soundExt, 1, false); + if (!paused) + FlxG.sound.playMusic("assets/music/" + SONG.song + "_Inst" + TitleState.soundExt, 1, false); FlxG.sound.music.onComplete = endSong; vocals.play(); }