From b79dbe4a74516c2ba8e43dff6bd236d377fd25f5 Mon Sep 17 00:00:00 2001 From: swordcube Date: Sat, 27 Apr 2024 08:14:01 -0500 Subject: [PATCH] Fix the pause menu crashing if a custom camera is not set --- source/funkin/menus/PauseSubState.hx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/funkin/menus/PauseSubState.hx b/source/funkin/menus/PauseSubState.hx index 870725bd..882e3cbc 100644 --- a/source/funkin/menus/PauseSubState.hx +++ b/source/funkin/menus/PauseSubState.hx @@ -170,16 +170,17 @@ class PauseSubState extends MusicBeatSubstate } override function destroy() { - if(FlxG.cameras.list.contains(camera)) - FlxG.cameras.remove(camera, true); + if(camera != FlxG.camera) { + if(FlxG.cameras.list.contains(camera)) + FlxG.cameras.remove(camera, true); + } pauseScript.call("destroy"); pauseScript.destroy(); - if (pauseMusic != null) - @:privateAccess { - FlxG.sound.destroySound(pauseMusic); - } - + if(pauseMusic != null) { + @:privateAccess + FlxG.sound.destroySound(pauseMusic); + } super.destroy(); }