Commit 93457e51 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4436 from NaterGator/joystickfix

Condition SDL counts so we don't pass negative numbers to new
parents 5faf2a95 47a2ae1c
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment