From 260f1bd2654f4e6e673ca5b77f9c6f9f5999b55a Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 20 Nov 2023 10:42:23 -0500 Subject: [PATCH] [BUGFIX] Fix an issue where PlayState would crash after the second song. (#216) * Ignore blank lines in intro text * Add a check when trying to render destroyed graphics. * Persist noteSplash graphic so it isn't destroyed. --- hmm.json | 2 +- source/funkin/play/notes/NoteSplash.hx | 1 + source/funkin/ui/title/TitleState.hx | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hmm.json b/hmm.json index 778b85604..977d17d77 100644 --- a/hmm.json +++ b/hmm.json @@ -11,7 +11,7 @@ "name": "flixel", "type": "git", "dir": null, - "ref": "32cee07a0e5f21e590a4b21234603b2cd5898b10", + "ref": "8437a86aa5dafdb3f5dcb91d212cb10a4ee6e53b", "url": "https://github.com/EliteMasterEric/flixel" }, { diff --git a/source/funkin/play/notes/NoteSplash.hx b/source/funkin/play/notes/NoteSplash.hx index bbe08546c..0ff8076c8 100644 --- a/source/funkin/play/notes/NoteSplash.hx +++ b/source/funkin/play/notes/NoteSplash.hx @@ -17,6 +17,7 @@ class NoteSplash extends FlxSprite public static function preloadFrames():Void { frameCollection = Paths.getSparrowAtlas('noteSplashes'); + frameCollection.parent.persist = true; } public function new() diff --git a/source/funkin/ui/title/TitleState.hx b/source/funkin/ui/title/TitleState.hx index da3ba6c89..7671bb336 100644 --- a/source/funkin/ui/title/TitleState.hx +++ b/source/funkin/ui/title/TitleState.hx @@ -232,7 +232,8 @@ class TitleState extends MusicBeatState { var fullText:String = Assets.getText(Paths.txt('introText')); - var firstArray:Array = fullText.split('\n'); + // Split into lines and remove empty lines + var firstArray:Array = fullText.split('\n').filter(function(s:String) return s != ''); var swagGoodArray:Array> = []; for (i in firstArray)