Allow binds to use hex values for all key codes

This commit is contained in:
Zack Middleton 2018-09-30 14:39:33 -05:00
parent 33a899d6dd
commit aab1d92b13

View file

@ -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,13 +835,10 @@ int Key_StringToKeynum( char *str ) {
}
// check for hex code
if ( strlen( str ) == 4 ) {
int n = Com_HexStrToInt( str );
if ( n >= 0 ) {
n = Com_HexStrToInt( str );
if ( n >= 0 && n < MAX_KEYS ) {
return n;
}
}
// scan for a text match
for ( kn=keynames ; kn->name ; kn++ ) {