Fix crash when pressing Enter key in formspec menu
parent
e52d811110
commit
6f851c9692
|
@ -2297,11 +2297,6 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
|
||||||
|
|
||||||
switch (event.KeyInput.Key) {
|
switch (event.KeyInput.Key) {
|
||||||
case KEY_RETURN:
|
case KEY_RETURN:
|
||||||
if (m_allowclose) {
|
|
||||||
acceptInput(true);
|
|
||||||
quitMenu();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
current_keys_pending.key_enter = true;
|
current_keys_pending.key_enter = true;
|
||||||
break;
|
break;
|
||||||
case KEY_UP:
|
case KEY_UP:
|
||||||
|
@ -2316,7 +2311,13 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
|
||||||
assert("reached a source line that can't ever been reached" == 0);
|
assert("reached a source line that can't ever been reached" == 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (current_keys_pending.key_enter && m_allowclose) {
|
||||||
|
acceptInput(true);
|
||||||
|
quitMenu();
|
||||||
|
}
|
||||||
|
else {
|
||||||
acceptInput();
|
acceptInput();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue