0
0
Fork 0
mirror of https://github.com/ryujinx-mirror/ryujinx.git synced 2024-12-22 19:25:44 +00:00

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>
This commit is contained in:
Luke 2024-04-15 17:02:09 -04:00 committed by GitHub
parent 268c9aecf8
commit 8884d1fd73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
{