mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-30 19:22:14 +00:00
Fix segfault with touch controls
This commit is contained in:
parent
6faa33459d
commit
12e83deece
1 changed files with 3 additions and 1 deletions
|
@ -213,9 +213,11 @@ static KeyPress id_to_keypress(touch_gui_button_id id)
|
||||||
|
|
||||||
assert(!setting_name.empty());
|
assert(!setting_name.empty());
|
||||||
const auto &keylist = getKeySetting(setting_name);
|
const auto &keylist = getKeySetting(setting_name);
|
||||||
if (keylist.empty())
|
if (keylist.empty()) {
|
||||||
warningstream << "TouchControls: Unbound or invalid key for "
|
warningstream << "TouchControls: Unbound or invalid key for "
|
||||||
<< setting_name << ", hiding button." << std::endl;
|
<< setting_name << ", hiding button." << std::endl;
|
||||||
|
return KeyPress();
|
||||||
|
}
|
||||||
return keylist[0];
|
return keylist[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue