diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 1be337cd1..d1102833e 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1846,8 +1846,6 @@ class FreeplayState extends MusicBeatSubState { if (_pressedOnSelected && TouchUtil.touch != null) { - // Have to turn off null safety in-order to compile this!! -Zack - @:nullSafety(Off) if (SwipeUtil.swipeLeft) { draggingDifficulty = true; @@ -2266,7 +2264,6 @@ class FreeplayState extends MusicBeatSubState #if FEATURE_TOUCH_CONTROLS function handleDiffDragRelease(diff:FlxSprite):Void { - @:nullSafety(Off) if ((diffSelLeft != null && diffSelLeft.x + 20 > diff.x) || SwipeUtil.justSwipedLeft) { handleDiffBoundaryChange(1); diff --git a/source/funkin/util/SwipeUtil.hx b/source/funkin/util/SwipeUtil.hx index ecddd76b0..36abfe793 100644 --- a/source/funkin/util/SwipeUtil.hx +++ b/source/funkin/util/SwipeUtil.hx @@ -143,7 +143,7 @@ class SwipeUtil { #if FEATURE_TOUCH_CONTROLS #if mobile - return TouchUtil.touch != null && TouchUtil.touch.justMovedUp; + return TouchUtil.touch?.justMovedUp ?? false; #else return FlxG.mouse.justMovedUp && FlxG.mouse.pressed; #end @@ -157,7 +157,7 @@ class SwipeUtil { #if FEATURE_TOUCH_CONTROLS #if mobile - return TouchUtil.touch != null && TouchUtil.touch.justMovedRight; + return TouchUtil.touch?.justMovedRight ?? false; #else return FlxG.mouse.justMovedRight && FlxG.mouse.pressed; #end @@ -171,7 +171,7 @@ class SwipeUtil { #if FEATURE_TOUCH_CONTROLS #if mobile - return TouchUtil.touch != null && TouchUtil.touch.justMovedLeft; + return TouchUtil.touch?.justMovedLeft ?? false; #else return FlxG.mouse.justMovedLeft && FlxG.mouse.pressed; #end @@ -185,7 +185,7 @@ class SwipeUtil { #if FEATURE_TOUCH_CONTROLS #if mobile - return TouchUtil.touch != null && TouchUtil.touch.justMovedDown; + return TouchUtil.touch?.justMovedDown ?? false; #else return FlxG.mouse.justMovedDown && FlxG.mouse.pressed; #end