diff --git a/hmm.json b/hmm.json index d1bd0007f..be6b7fea0 100644 --- a/hmm.json +++ b/hmm.json @@ -66,8 +66,10 @@ }, { "name": "hxCodec", - "type": "haxelib", - "version": "3.0.1" + "type": "git", + "dir": null, + "ref": "develop", + "url": "https://github.com/polybiusproxy/hxCodec" }, { "name": "hxcpp", diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index ae57f3cd5..78c953e99 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -686,6 +686,9 @@ class PlayState extends MusicBeatSubState currentStage.resetStage(); + playerStrumline.clean(); + opponentStrumline.clean(); + // Delete all notes and reset the arrays. regenNoteData(); diff --git a/source/funkin/play/notes/Strumline.hx b/source/funkin/play/notes/Strumline.hx index 40bd8656a..0407d8ffc 100644 --- a/source/funkin/play/notes/Strumline.hx +++ b/source/funkin/play/notes/Strumline.hx @@ -398,6 +398,38 @@ class Strumline extends FlxSpriteGroup return heldKeys[dir]; } + /** + * Called when the song is reset. + * Removes any special animations and the like. + * Doesn't reset the notes from the chart, that's handled by the PlayState. + */ + public function clean():Void + { + for (note in notes.members) + { + if (note == null) continue; + killNote(note); + } + + for (holdNote in holdNotes.members) + { + if (holdNote == null) continue; + holdNote.kill(); + } + + for (splash in noteSplashes) + { + if (splash == null) continue; + splash.kill(); + } + + for (cover in noteHoldCovers) + { + if (cover == null) continue; + cover.kill(); + } + } + public function applyNoteData(data:Array):Void { this.notes.clear(); @@ -425,6 +457,7 @@ class Strumline extends FlxSpriteGroup public function killNote(note:NoteSprite):Void { + if (note == null) return; note.visible = false; notes.remove(note, false); note.kill(); diff --git a/source/funkin/play/notes/SustainTrail.hx b/source/funkin/play/notes/SustainTrail.hx index fdd613667..72d22191b 100644 --- a/source/funkin/play/notes/SustainTrail.hx +++ b/source/funkin/play/notes/SustainTrail.hx @@ -289,6 +289,20 @@ class SustainTrail extends FlxSprite missedNote = false; } + public override function revive():Void + { + super.revive(); + + strumTime = 0; + noteDirection = 0; + sustainLength = 0; + fullSustainLength = 0; + noteData = null; + + hitNote = false; + missedNote = false; + } + override public function destroy():Void { vertices = null;