mirror of https://github.com/OpenTTD/OpenTTD
Fix 4dd5f994: hotkey parsing was broken
parent
397221b94a
commit
ee8b1dfbc3
|
@ -99,7 +99,7 @@ static uint16 ParseCode(const char *start, const char *end)
|
||||||
assert(start <= end);
|
assert(start <= end);
|
||||||
while (start < end && *start == ' ') start++;
|
while (start < end && *start == ' ') start++;
|
||||||
while (end > start && *end == ' ') end--;
|
while (end > start && *end == ' ') end--;
|
||||||
std::string_view str{start, (size_t)(start - end)};
|
std::string_view str{start, (size_t)(end - start)};
|
||||||
for (uint i = 0; i < lengthof(_keycode_to_name); i++) {
|
for (uint i = 0; i < lengthof(_keycode_to_name); i++) {
|
||||||
if (StrEqualsIgnoreCase(str, _keycode_to_name[i].name)) {
|
if (StrEqualsIgnoreCase(str, _keycode_to_name[i].name)) {
|
||||||
return _keycode_to_name[i].keycode;
|
return _keycode_to_name[i].keycode;
|
||||||
|
|
Loading…
Reference in New Issue