diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-03-09 18:03:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-03-09 18:03:56 +0300 |
commit | c4132a81d876d6414dee73ca94eb02aeff35ac14 (patch) | |
tree | 801862cf07ec3a3babeb0a911794cf38cd0d9431 | |
parent | 8099bdeb0f4d00f4286159d3004e61976d2a7872 (diff) | |
download | ManaVerse-c4132a81d876d6414dee73ca94eb02aeff35ac14.tar.gz ManaVerse-c4132a81d876d6414dee73ca94eb02aeff35ac14.tar.bz2 ManaVerse-c4132a81d876d6414dee73ca94eb02aeff35ac14.tar.xz ManaVerse-c4132a81d876d6414dee73ca94eb02aeff35ac14.zip |
Validate reading keys from config.
-rw-r--r-- | src/keyboardconfig.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index cf620148e..50bdaf295 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -397,6 +397,9 @@ void KeyboardConfig::retrieve() { mKey[i].value = static_cast<int>(config.getValue( mKey[i].configField, mKey[i].defaultValue)); + logger->log("key: %d", mKey[i].value); + if (mKey[i].value < -255 || mKey[i].value > SDLK_LAST) + mKey[i].value = KEY_NO_VALUE; } } } |