Changeset - r17342:1be18c904f97
[Not reviewed]
master
0 1 0
yexo - 14 years ago 2011-02-17 23:14:43
yexo@openttd.org
(svn r22094) -Fix [FS#4510]: remove invalid keycodes when reading hotkeys.cfg
1 file changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/hotkeys.cpp
Show inline comments
 
@@ -95,8 +95,14 @@ static uint16 ParseKeycode(const char *s
 
		uint16 code = ParseCode(start, cur);
 
		if (code == 0) return 0;
 
		if (code & WKC_SPECIAL_KEYS) {
 
			/* Some completely wrong keycode we don't support. */
 
			if (code & ~WKC_SPECIAL_KEYS) return 0;
 
			keycode |= code;
 
		} else {
 
			/* Ignore invalid keycodes */
 
			if (code >= 128) {
 
				return 0;
 
			}
 
			/* Ignore the code if it has more then 1 letter. */
 
			if (keycode & ~WKC_SPECIAL_KEYS) return 0;
 
			keycode |= code;
0 comments (0 inline, 0 general)