Clear haptic effect ID after destroying it

This commit is contained in:
Cameron Gutman committed 2026-11-14 23:00:32 -06:00
1 parent 9fa8b15642
commit bae838eeb9
1 file changed
+1
+1
View File
@@ -862,6 +862,7 @@ void SdlInputHandler::rumble(unsigned short controllerNumber, unsigned short low
if (m_GamepadState[controllerNumber].hapticMethod == GAMEPAD_HAPTIC_METHOD_LEFTRIGHT) {
if (m_GamepadState[controllerNumber].hapticEffectId >= 0) {
SDL_HapticDestroyEffect(haptic, m_GamepadState[controllerNumber].hapticEffectId);
m_GamepadState[controllerNumber].hapticEffectId = -1;
}
} else if (m_GamepadState[controllerNumber].hapticMethod == GAMEPAD_HAPTIC_METHOD_SIMPLERUMBLE) {
SDL_HapticRumbleStop(haptic);