ensure that only freeplay camera gets destroyed

This commit is contained in:
rich 2024-05-14 04:30:36 +04:00 committed by GitHub
parent 3810662f9f
commit 59e409f8e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -131,6 +131,7 @@ class FreeplayState extends MusicBeatSubState
var exitMovers:ExitMoverData = new Map();
var stickerSubState:StickerSubState;
var funnyCam:FunkinCamera;
public static var rememberedDifficulty:Null<String> = Constants.DEFAULT_DIFFICULTY;
public static var rememberedSongId:Null<String> = 'tutorial';
@ -535,7 +536,7 @@ class FreeplayState extends MusicBeatSubState
generateSongList(null, false);
// dedicated camera for the state so we don't need to fuk around with camera scrolls from the mainmenu / elsewhere
var funnyCam:FunkinCamera = new FunkinCamera('freeplayFunny', 0, 0, FlxG.width, FlxG.height);
funnyCam = new FunkinCamera('freeplayFunny', 0, 0, FlxG.width, FlxG.height);
funnyCam.bgColor = FlxColor.TRANSPARENT;
FlxG.cameras.add(funnyCam, false);
@ -989,7 +990,7 @@ class FreeplayState extends MusicBeatSubState
clearDaCache(daSong.songName);
}
// remove and destroy freeplay camera
FlxG.cameras.remove(FlxG.cameras.list[FlxG.cameras.list.length - 1]);
FlxG.cameras.remove(funnyCam);
}
function changeDiff(change:Int = 0, force:Bool = false):Void