diff --git a/golded3/gckeys.cpp b/golded3/gckeys.cpp index ac62973..35664de 100644 --- a/golded3/gckeys.cpp +++ b/golded3/gckeys.cpp @@ -986,9 +986,17 @@ int ReadKeysCfg(int force) { continue; } *ptr++ = NUL; - keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &keytype); - if(keycmd) { - if(keytype) { + // If either straight Key or $Key do not make lookup by CRC + if(*ptr2 == '$') { + uint _keyval = 0; + sscanf(ptr2+1, "%4x", &_keyval); + keyval = (gkey)_keyval; + } + else if(strlen(ptr2) == 1) + keyval = (gkey)tolower(*ptr2); // Always convert to lowercase internally + else { + keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &keytype); + if(not keycmd or keytype) { std::cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl; SayBibi(); cfgerrors++; @@ -996,21 +1004,6 @@ int ReadKeysCfg(int force) { } keyval = keycmd; } - else { // Either straight Key or $Key - if(*ptr2 == '$') { - uint _keyval = 0; - sscanf(ptr2+1, "%4x", &_keyval); - keyval = (gkey)_keyval; - } - else if(strlen(ptr2) == 1) - keyval = (gkey)tolower(*ptr2); // Always convert to lowercase internally - else { - std::cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl; - SayBibi(); - cfgerrors++; - continue; - } - } ptr = strskip_wht(ptr); ptr2 = ptr; ptr = strskip_txt(ptr);