aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/kyra_v1.cpp6
-rw-r--r--engines/kyra/kyra_v1.h3
2 files changed, 7 insertions, 2 deletions
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index 37def456c7..875f4a6ba5 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -282,7 +282,11 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag)
quitGame();
}
} else {
- keys = _keyMap[event.kbd.keycode];
+ KeyMap::const_iterator keycode = _keyMap.find(event.kbd.keycode);
+ if (keycode != _keyMap.end())
+ keys = keycode->_value;
+ else
+ keys = 0;
// When we got an keypress, which we might need to handle,
// break the event loop and pass it to GUI code.
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 23fe09668c..5330f2b105 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -223,7 +223,8 @@ protected:
operator Common::Event() const { return event; }
};
Common::List<Event> _eventList;
- Common::HashMap<int, int16> _keyMap;
+ typedef Common::HashMap<int, int16> KeyMap;
+ KeyMap _keyMap;
// config specific
virtual void registerDefaultSettings();