diff --git a/source/funkin/game/NoteGroup.hx b/source/funkin/game/NoteGroup.hx index 0d45a41f..9feda854 100644 --- a/source/funkin/game/NoteGroup.hx +++ b/source/funkin/game/NoteGroup.hx @@ -34,10 +34,16 @@ class NoteGroup extends FlxTypedGroup { return FlxSort.byValues(FlxSort.DESCENDING, n1.strumTime, n2.strumTime); }); } + + @:dox(hide) public var __forcedSongPos:Null = null; + + @:dox(hide) private inline function __getSongPos() + return __forcedSongPos == null ? Conductor.songPosition : __forcedSongPos; + public override function update(elapsed:Float) { i = length-1; __loopSprite = null; - __time = Conductor.songPosition; + __time = __getSongPos(); while(i >= 0) { __loopSprite = members[i--]; if (__loopSprite == null || !__loopSprite.exists || !__loopSprite.active) { @@ -58,7 +64,7 @@ class NoteGroup extends FlxTypedGroup { i = length-1; __loopSprite = null; - __time = Conductor.songPosition; + __time = __getSongPos(); while(i >= 0) { __loopSprite = members[i--]; if (__loopSprite == null || !__loopSprite.exists || !__loopSprite.visible) @@ -81,7 +87,7 @@ class NoteGroup extends FlxTypedGroup { public override function forEach(noteFunc:Note->Void, recursive:Bool = false) { i = length-1; __loopSprite = null; - __time = Conductor.songPosition; + __time = __getSongPos(); var oldCur = __currentlyLooping; __currentlyLooping = true; diff --git a/source/funkin/menus/PauseSubState.hx b/source/funkin/menus/PauseSubState.hx index 2366990c..fb2326e5 100644 --- a/source/funkin/menus/PauseSubState.hx +++ b/source/funkin/menus/PauseSubState.hx @@ -12,6 +12,7 @@ import flixel.tweens.FlxTween; import flixel.util.FlxColor; import funkin.options.keybinds.KeybindsOptions; import funkin.menus.StoryMenuState; +import funkin.backend.system.Conductor; import funkin.backend.utils.FunkinParentDisabler; class PauseSubState extends MusicBeatSubstate @@ -162,6 +163,9 @@ class PauseSubState extends MusicBeatSubstate PlayState.resetSongInfos(); if (Charter.instance != null) Charter.instance.__clearStatics(); + // prevents certain notes to disappear early when exiting - Nex + game.strumLines.forEachAlive(function(grp) grp.notes.__forcedSongPos = Conductor.songPosition); + CoolUtil.playMenuSong(); FlxG.switchState(PlayState.isStoryMode ? new StoryMenuState() : new FreeplayState()); }