Browse Source

Condition SDL counts so we don't pass negative numbers to new

Should address #4425
QGC4.4
Nate Weibley 8 years ago committed by Daniel Agar
parent
commit
4a25648425
  1. 2
      src/Joystick/JoystickSDL.cc

2
src/Joystick/JoystickSDL.cc

@ -49,7 +49,7 @@ QMap<QString, Joystick*> JoystickSDL::discover(MultiVehicleManager* _multiVehicl @@ -49,7 +49,7 @@ QMap<QString, Joystick*> JoystickSDL::discover(MultiVehicleManager* _multiVehicl
SDL_JoystickClose(sdlJoystick);
qCDebug(JoystickLog) << "\t" << name << "axes:" << axisCount << "buttons:" << buttonCount << "hats:" << hatCount << "isGC:" << isGameController;
ret[name] = new JoystickSDL(name, axisCount, buttonCount, hatCount, i, isGameController, _multiVehicleManager);
ret[name] = new JoystickSDL(name, qMax(0,axisCount), qMax(0,buttonCount), qMax(0,hatCount), i, isGameController, _multiVehicleManager);
} else {
qCDebug(JoystickLog) << "\tSkipping duplicate" << name;
}

Loading…
Cancel
Save