From 4e81a4c2f4fee6f31e28fbb129759ec2369da6eb Mon Sep 17 00:00:00 2001 From: sh0inx Date: Sun, 15 Mar 2026 09:46:36 -0500 Subject: [PATCH] [HLE] Added "null" check for isAtRest (ryubing/ryujinx!287) See merge request ryubing/ryujinx!287 --- src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs b/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs index 990b2e288..5acee3bb7 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs +++ b/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs @@ -584,8 +584,13 @@ namespace Ryujinx.HLE.HOS.Services.Hid public bool isAtRest(int playerNumber) { - ref NpadInternalState currentNpad = ref _device.Hid.SharedMemory.Npads[playerNumber].InternalState; + + if (currentNpad.StyleSet == NpadStyleTag.None) + { + return true; // it will always be at rest because it cannot move. + } + ref SixAxisSensorState storage = ref GetSixAxisSensorLifo(ref currentNpad, false).GetCurrentEntryRef(); float acceleration = Math.Abs(storage.Acceleration.X)