From cbd7e0a3f55bfd01747ab0fb93453f2834151e62 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Sat, 15 Apr 2023 17:02:06 +0200 Subject: [PATCH] Fixed controls crash --- commit-public.BAT | 6 +++++- source/funkin/savedata/FunkinSave.hx | 4 +++- source/funkin/system/MusicBeatSubstate.hx | 3 ++- source/funkin/system/MusicBeatTransition.hx | 7 ++++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/commit-public.BAT b/commit-public.BAT index 110f5421..054b5f94 100644 --- a/commit-public.BAT +++ b/commit-public.BAT @@ -5,6 +5,10 @@ echo Commiting with the message %1... echo ============================== git commit -a -m %1 echo ============================== -echo Pushing... +echo Pushing to dev repo... +echo ============================== +git push -u origin dev +echo ============================== +echo Pushing to public repo... echo ============================== git push -u origin main \ No newline at end of file diff --git a/source/funkin/savedata/FunkinSave.hx b/source/funkin/savedata/FunkinSave.hx index 4b22d4e4..0643d99c 100644 --- a/source/funkin/savedata/FunkinSave.hx +++ b/source/funkin/savedata/FunkinSave.hx @@ -13,7 +13,9 @@ class FunkinSave { public static var highscores:Map = []; - // STUFF + /** + * ONLY OPEN IF YOU WANT TO EDIT FUNCTIONS RELATED TO SAVING, LOADING OR HIGHSCORES. + */ #if REGION @:dox(hide) @:doNotSave private static var __eventAdded = false; diff --git a/source/funkin/system/MusicBeatSubstate.hx b/source/funkin/system/MusicBeatSubstate.hx index c084a6da..61b2fa03 100644 --- a/source/funkin/system/MusicBeatSubstate.hx +++ b/source/funkin/system/MusicBeatSubstate.hx @@ -253,7 +253,8 @@ class MusicBeatSubstate extends FlxSubState implements IBeatReceiver if (subState != null && subState is MusicBeatSubstate) { cast(subState, MusicBeatSubstate).parent = this; super.resetSubState(); - cast(subState, MusicBeatSubstate).onSubstateOpen(); + if (subState != null) + cast(subState, MusicBeatSubstate).onSubstateOpen(); return; } super.resetSubState(); diff --git a/source/funkin/system/MusicBeatTransition.hx b/source/funkin/system/MusicBeatTransition.hx index 748e924f..61c0d7c2 100644 --- a/source/funkin/system/MusicBeatTransition.hx +++ b/source/funkin/system/MusicBeatTransition.hx @@ -6,6 +6,8 @@ import funkin.utils.FunkinParentDisabler; class MusicBeatTransition extends MusicBeatSubstate { var nextFrameSkip:Bool = false; + + public var transitionTween:FlxTween = null; public var transitionCamera:FlxCamera; public var newState:FlxState; @@ -45,7 +47,7 @@ class MusicBeatTransition extends MusicBeatSubstate { add(transitionSprite); transitionCamera.scroll.y = transitionCamera.height; - FlxTween.tween(transitionCamera.scroll, {y: -transitionCamera.height}, 2/3, { + transitionTween = FlxTween.tween(transitionCamera.scroll, {y: -transitionCamera.height}, 2/3, { ease: FlxEase.sineOut, onComplete: function(_) { finish(); @@ -79,6 +81,9 @@ class MusicBeatTransition extends MusicBeatSubstate { } public override function destroy() { + if (transitionTween != null) + transitionTween.cancel(); + transitionTween = FlxDestroyUtil.destroy(transitionTween); if (newState == null && FlxG.cameras.list.contains(transitionCamera)) FlxG.cameras.remove(transitionCamera); else