From d9b5805ba562f97f700ee154b7e1da0fbbaed97c Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 22 Apr 2022 09:12:48 -0700
Subject: [PATCH] Return a correlation error when trigger rumble is attempted
without correlation
---
src/joystick/windows/SDL_rawinputjoystick.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c
index 562be9b003c..367cbb7ed36 100644
--- a/src/joystick/windows/SDL_rawinputjoystick.c
+++ b/src/joystick/windows/SDL_rawinputjoystick.c
@@ -1322,8 +1322,10 @@ RAWINPUT_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint
if (!SUCCEEDED(hr)) {
return SDL_SetError("Setting vibration failed: 0x%lx\n", hr);
}
+ return 0:
+ } else {
+ return SDL_SetError("Controller isn't correlated yet, try hitting a button first");
}
- return 0;
#else
return SDL_Unsupported();
#endif