summaryrefslogtreecommitdiff
path: root/src/joystick.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-01 20:04:35 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-01 20:04:35 +0300
commitb8cdabbd20690d57930dce9dda949fca21a6233a (patch)
treeddd3d0a3bb4d83206b92ede95b330430e803e26b /src/joystick.cpp
parentab1f66527863c7fcce6c3ccedda0d5560dc063c7 (diff)
downloadmv-b8cdabbd20690d57930dce9dda949fca21a6233a.tar.gz
mv-b8cdabbd20690d57930dce9dda949fca21a6233a.tar.bz2
mv-b8cdabbd20690d57930dce9dda949fca21a6233a.tar.xz
mv-b8cdabbd20690d57930dce9dda949fca21a6233a.zip
Eliminate asserts from most files.
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);