Explorar o código

Fix crash when changing controller config (#6654)

* fix needsMotionInputUpdate conditions

* Fix formatting

Co-authored-by: gdkchan <gab.dark.100@gmail.com>

---------

Co-authored-by: gdkchan <gab.dark.100@gmail.com>
Luke %!s(int64=2) %!d(string=hai) anos
pai
achega
8884d1fd73
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      src/Ryujinx.Input/HLE/NpadController.cs

+ 3 - 3
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)
                 {