diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-11 03:40:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-11 03:40:16 +0300 |
commit | dc53f8b7f360a489bd10355131339809d66378ef (patch) | |
tree | d97daa27aefe91866e8b64864c58236291f38b14 /src/inputmanager.cpp | |
parent | c810ee1fe7b42202a66935575a88264911f2c625 (diff) | |
download | manaplus-dc53f8b7f360a489bd10355131339809d66378ef.tar.gz manaplus-dc53f8b7f360a489bd10355131339809d66378ef.tar.bz2 manaplus-dc53f8b7f360a489bd10355131339809d66378ef.tar.xz manaplus-dc53f8b7f360a489bd10355131339809d66378ef.zip |
Add joystick validation before triggering events from it.
Diffstat (limited to 'src/inputmanager.cpp')
-rw-r--r-- | src/inputmanager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/inputmanager.cpp b/src/inputmanager.cpp index 8a9e89995..e7ac40cf0 100644 --- a/src/inputmanager.cpp +++ b/src/inputmanager.cpp @@ -489,8 +489,11 @@ bool InputManager::handleEvent(const SDL_Event &event) break; case SDL_JOYBUTTONDOWN: - if (triggerAction(joystick->getActionVector(event))) - return true; + if (joystick && joystick->validate()) + { + if (triggerAction(joystick->getActionVector(event))) + return true; + } break; default: break; |