From aab1d92b13c4bd67ea8324d9cf39a6d254a98c7c Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 30 Sep 2018 14:39:33 -0500 Subject: [PATCH] Allow binds to use hex values for all key codes --- code/client/cl_keys.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/code/client/cl_keys.c b/code/client/cl_keys.c index b2bc9559..c786f526 100644 --- a/code/client/cl_keys.c +++ b/code/client/cl_keys.c @@ -825,6 +825,7 @@ to be configured even if they don't have defined names. */ int Key_StringToKeynum( char *str ) { keyname_t *kn; + int n; if ( !str || !str[0] ) { return -1; @@ -834,12 +835,9 @@ int Key_StringToKeynum( char *str ) { } // check for hex code - if ( strlen( str ) == 4 ) { - int n = Com_HexStrToInt( str ); - - if ( n >= 0 ) { - return n; - } + n = Com_HexStrToInt( str ); + if ( n >= 0 && n < MAX_KEYS ) { + return n; } // scan for a text match