From 8884d1fd732c9ba788f0ab711e6a9f507d934ac8 Mon Sep 17 00:00:00 2001 From: Luke <44324377+Luke44565@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:02:09 -0400 Subject: [PATCH] Fix crash when changing controller config (#6654) * fix needsMotionInputUpdate conditions * Fix formatting Co-authored-by: gdkchan --------- Co-authored-by: gdkchan --- src/Ryujinx.Input/HLE/NpadController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx.Input/HLE/NpadController.cs b/src/Ryujinx.Input/HLE/NpadController.cs index f00db94e2..8411c10a7 100644 --- a/src/Ryujinx.Input/HLE/NpadController.cs +++ b/src/Ryujinx.Input/HLE/NpadController.cs @@ -245,9 +245,9 @@ namespace Ryujinx.Input.HLE { if (config is StandardControllerInputConfig controllerConfig) { - bool needsMotionInputUpdate = _config == null || (_config is StandardControllerInputConfig oldControllerConfig && - (oldControllerConfig.Motion.EnableMotion != controllerConfig.Motion.EnableMotion) && - (oldControllerConfig.Motion.MotionBackend != controllerConfig.Motion.MotionBackend)); + bool needsMotionInputUpdate = _config is not StandardControllerInputConfig oldControllerConfig || + ((oldControllerConfig.Motion.EnableMotion != controllerConfig.Motion.EnableMotion) && + (oldControllerConfig.Motion.MotionBackend != controllerConfig.Motion.MotionBackend)); if (needsMotionInputUpdate) {