diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 3049747f..6042a91b 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -624,6 +624,7 @@ class PlayState extends MusicBeatState } else { FlxG.camera.focusOn(camFollow.getPosition()); } + smoothTransitionData = null; FlxG.worldBounds.set(0, 0, FlxG.width, FlxG.height); @@ -1246,16 +1247,7 @@ class PlayState extends MusicBeatState trace('LOADING NEXT SONG'); trace(PlayState.storyPlaylist[0].toLowerCase(), difficulty); - smoothTransitionData = { - stage: curStage, - camX: FlxG.camera.scroll.x, - camY: FlxG.camera.scroll.y, - camFollowX: camFollow.x, - camFollowY: camFollow.y, - camZoom: FlxG.camera.zoom - }; - FlxTransitionableState.skipNextTransIn = true; - FlxTransitionableState.skipNextTransOut = true; + registerSmoothTransition(); FlxG.sound.music.stop(); @@ -1271,6 +1263,19 @@ class PlayState extends MusicBeatState } } + public function registerSmoothTransition() { + smoothTransitionData = { + stage: curStage, + camX: FlxG.camera.scroll.x, + camY: FlxG.camera.scroll.y, + camFollowX: camFollow.x, + camFollowY: camFollow.y, + camZoom: FlxG.camera.zoom + }; + FlxTransitionableState.skipNextTransIn = true; + FlxTransitionableState.skipNextTransOut = true; + } + var __funcsToExec:ArrayVoid> = []; var __pressed:Array = []; var __justPressed:Array = []; diff --git a/source/funkin/menus/PauseSubState.hx b/source/funkin/menus/PauseSubState.hx index 8b106a25..9efe54ea 100644 --- a/source/funkin/menus/PauseSubState.hx +++ b/source/funkin/menus/PauseSubState.hx @@ -137,6 +137,7 @@ class PauseSubState extends MusicBeatSubstate case "Resume": close(); case "Restart Song": + PlayState.instance.registerSmoothTransition(); FlxG.resetState(); case "Change Controls": persistentDraw = false;