fix: fix crash in LatencyState when exiting / cleaning up state data

This commit is contained in:
lemz 2024-09-30 21:29:36 +02:00 committed by Cameron Taylor
parent b0b73c8399
commit 39b1a42cfe

View file

@ -199,7 +199,11 @@ class LatencyState extends MusicBeatSubState
PreciseInputManager.instance.onInputPressed.remove(preciseInputPressed); PreciseInputManager.instance.onInputPressed.remove(preciseInputPressed);
PreciseInputManager.instance.onInputReleased.remove(preciseInputReleased); PreciseInputManager.instance.onInputReleased.remove(preciseInputReleased);
FlxG.sound.music.volume = previousVolume; if (FlxG.sound.music != null)
{
FlxG.sound.music.volume = previousVolume;
}
swagSong.stop(); swagSong.stop();
FlxG.sound.list.remove(swagSong); FlxG.sound.list.remove(swagSong);