summaryrefslogtreecommitdiff
path: root/src/keyboardconfig.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-10 16:36:34 -0600
committerIra Rice <irarice@gmail.com>2009-03-10 17:38:58 -0600
commitbb45b6a8ca4ea751bceb5853060251a3eefcd4fc (patch)
tree447632430f7785c9f14b5ba8ca50dc8014fb6133 /src/keyboardconfig.cpp
parent265172dc1e7b97611c485752dc10345545c4e296 (diff)
downloadmana-bb45b6a8ca4ea751bceb5853060251a3eefcd4fc.tar.gz
mana-bb45b6a8ca4ea751bceb5853060251a3eefcd4fc.tar.bz2
mana-bb45b6a8ca4ea751bceb5853060251a3eefcd4fc.tar.xz
mana-bb45b6a8ca4ea751bceb5853060251a3eefcd4fc.zip
Delete local player earlier and fix a rare crash
Rare crash is in KeyboardConfig, where the active keys array is accessed before it's initialized. Also remove some debug prints that made it into a previous commit.
Diffstat (limited to 'src/keyboardconfig.cpp')
-rw-r--r--src/keyboardconfig.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp
index 8187bef7..8ed23c65 100644
--- a/src/keyboardconfig.cpp
+++ b/src/keyboardconfig.cpp
@@ -198,7 +198,8 @@ int KeyboardConfig::getKeyEmoteOffset(int keyValue) const
bool KeyboardConfig::isKeyActive(int index)
{
- return mActiveKeys[ mKey[index].value];
+ if (!mActiveKeys) return false;
+ return mActiveKeys[mKey[index].value];
}
void KeyboardConfig::refreshActiveKeys()