From e84fdf9fac2def3e6b880732b767585477ae5cc9 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 26 Mar 2024 19:38:42 -0400 Subject: [PATCH 1/4] Resolve FlxG.sound.music crash --- source/funkin/play/PlayState.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index a8cb879a3..62801028f 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2941,7 +2941,7 @@ class PlayState extends MusicBeatSubState if (overrideMusic) { // Stop the music. Do NOT destroy it, something still references it! - FlxG.sound.music.pause(); + if (FlxG.sound.music != null) FlxG.sound.music.pause(); if (vocals != null) { vocals.pause(); @@ -2951,7 +2951,7 @@ class PlayState extends MusicBeatSubState else { // Stop and destroy the music. - FlxG.sound.music.pause(); + if (FlxG.sound.music != null) FlxG.sound.music.pause(); if (vocals != null) { vocals.destroy(); From 9ebb253b53a931c019a54794b0805a4d3a830654 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 26 Mar 2024 19:38:56 -0400 Subject: [PATCH 2/4] Fix music updating issue. --- source/funkin/audio/FunkinSound.hx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/funkin/audio/FunkinSound.hx b/source/funkin/audio/FunkinSound.hx index 687860265..9d6dee6ef 100644 --- a/source/funkin/audio/FunkinSound.hx +++ b/source/funkin/audio/FunkinSound.hx @@ -50,6 +50,11 @@ class FunkinSound extends FlxSound implements ICloneable */ static var pool(default, null):FlxTypedGroup = new FlxTypedGroup(); + /** + * Calculate the current time of the sound. + * NOTE: You need to `add()` the sound to the scene for `update()` to increment the time. + */ + // public var muted(default, set):Bool = false; function set_muted(value:Bool):Bool @@ -392,8 +397,6 @@ class FunkinSound extends FlxSound implements ICloneable // Call onLoad() because the sound already loaded if (onLoad != null && sound._sound != null) onLoad(); - FlxG.sound.list.remove(FlxG.sound.music); - return sound; } From 291a9f630d9a29406d75fe8a50b49a24ab07bd2d Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 26 Mar 2024 19:39:02 -0400 Subject: [PATCH 3/4] Update assets submodule --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 8bb6214e1..d2946604e 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 8bb6214e16c823b8b5a522a39b7a7e01d6283abf +Subproject commit d2946604e1dfb4fb80f6bf3cb73da8538963eade From 17df6a515fa3c79e2bd25f7fbdd4f9d545564128 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 27 Mar 2024 22:11:31 -0400 Subject: [PATCH 4/4] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index d2946604e..485243fdd 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit d2946604e1dfb4fb80f6bf3cb73da8538963eade +Subproject commit 485243fdd44acbc4db6a97ec7bf10a8b18350be9