From 022de60b2a1ec0604cb1c3e23fe4254219da5fd0 Mon Sep 17 00:00:00 2001 From: Leather128 <81660872+Leather128@users.noreply.github.com> Date: Sat, 6 Nov 2021 10:06:16 -0400 Subject: [PATCH] fixed freeplay crash --- source/states/FreeplayState.hx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/states/FreeplayState.hx b/source/states/FreeplayState.hx index 3cafdc0091..a998ffe6e4 100644 --- a/source/states/FreeplayState.hx +++ b/source/states/FreeplayState.hx @@ -290,7 +290,8 @@ class FreeplayState extends MusicBeatState #if cpp @:privateAccess { - lime.media.openal.AL.sourcef(FlxG.sound.music._channel.__source.__backend.handle, lime.media.openal.AL.PITCH, curSpeed); + if(FlxG.sound.music.active && FlxG.sound.music.playing) + lime.media.openal.AL.sourcef(FlxG.sound.music._channel.__source.__backend.handle, lime.media.openal.AL.PITCH, curSpeed); if (vocals.playing) lime.media.openal.AL.sourcef(vocals._channel.__source.__backend.handle, lime.media.openal.AL.PITCH, curSpeed); @@ -307,7 +308,8 @@ class FreeplayState extends MusicBeatState #if cpp @:privateAccess { - lime.media.openal.AL.sourcef(FlxG.sound.music._channel.__source.__backend.handle, lime.media.openal.AL.PITCH, curSpeed); + if(FlxG.sound.music.active && FlxG.sound.music.playing) + lime.media.openal.AL.sourcef(FlxG.sound.music._channel.__source.__backend.handle, lime.media.openal.AL.PITCH, curSpeed); if (vocals.playing) lime.media.openal.AL.sourcef(vocals._channel.__source.__backend.handle, lime.media.openal.AL.PITCH, curSpeed); @@ -322,7 +324,8 @@ class FreeplayState extends MusicBeatState #if cpp @:privateAccess { - lime.media.openal.AL.sourcef(FlxG.sound.music._channel.__source.__backend.handle, lime.media.openal.AL.PITCH, curSpeed); + if(FlxG.sound.music.active && FlxG.sound.music.playing) + lime.media.openal.AL.sourcef(FlxG.sound.music._channel.__source.__backend.handle, lime.media.openal.AL.PITCH, curSpeed); if (vocals.playing) lime.media.openal.AL.sourcef(vocals._channel.__source.__backend.handle, lime.media.openal.AL.PITCH, curSpeed);