mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-04 00:36:36 +00:00
Check rumble controller number is within the supported range
This commit is contained in:
parent
5397e8ae1a
commit
b878d64460
@ -812,6 +812,11 @@ void SdlInputHandler::handleJoystickArrivalEvent(SDL_JoyDeviceEvent* event)
|
|||||||
|
|
||||||
void SdlInputHandler::rumble(unsigned short controllerNumber, unsigned short lowFreqMotor, unsigned short highFreqMotor)
|
void SdlInputHandler::rumble(unsigned short controllerNumber, unsigned short lowFreqMotor, unsigned short highFreqMotor)
|
||||||
{
|
{
|
||||||
|
// Make sure the controller number is within our supported count
|
||||||
|
if (controllerNumber >= MAX_GAMEPADS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the controller supports haptics (and if the controller exists at all)
|
// Check if the controller supports haptics (and if the controller exists at all)
|
||||||
SDL_Haptic* haptic = m_GamepadState[controllerNumber].haptic;
|
SDL_Haptic* haptic = m_GamepadState[controllerNumber].haptic;
|
||||||
if (haptic == nullptr) {
|
if (haptic == nullptr) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user