summaryrefslogtreecommitdiff
path: root/src/joystick.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/joystick.cpp')
-rw-r--r--src/joystick.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/joystick.cpp b/src/joystick.cpp
index 8f808a2d1..f45729351 100644
--- a/src/joystick.cpp
+++ b/src/joystick.cpp
@@ -24,8 +24,6 @@
#include "joystick.h"
#include "logger.h"
-#include <cassert>
-
#include "debug.h"
int Joystick::joystickCount = 0;
@@ -48,7 +46,8 @@ Joystick::Joystick(int no):
mCalibrating(false),
mEnabled(false)
{
- assert(no < joystickCount);
+ if (no >= joystickCount)
+ no = joystickCount;
mJoystick = SDL_JoystickOpen(no);