summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2018-10-07 18:41:35 +0200
committerGitHub <noreply@github.com>2018-10-07 18:41:35 +0200
commitb04b83bdcefcbc7e49c68eecd04ffa57175b488b (patch)
treea2ef8358e588faa2ef1332e1b875841c06d33420 /scene/gui
parent604810f611d0dc1174d9e0b012bbb5a7cfceaf6c (diff)
parente355a8fc4c36d4417b32acd0d5cf27a1b15d6669 (diff)
Merge pull request #22830 from Faless/fix_joypad_tree_crash
Fix crash in Tree when moving using Joypad
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/tree.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 3a540d187b..effa44968d 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -2183,6 +2183,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
Ref<InputEventKey> k = p_event;
+ bool is_command = k.is_valid() && k->get_command();
if (p_event->is_action("ui_right") && p_event->is_pressed()) {
if (!cursor_can_exit_tree) accept_event();
@@ -2219,13 +2220,13 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
_go_left();
}
- } else if (p_event->is_action("ui_up") && p_event->is_pressed() && !k->get_command()) {
+ } else if (p_event->is_action("ui_up") && p_event->is_pressed() && !is_command) {
if (!cursor_can_exit_tree) accept_event();
_go_up();
- } else if (p_event->is_action("ui_down") && p_event->is_pressed() && !k->get_command()) {
+ } else if (p_event->is_action("ui_down") && p_event->is_pressed() && !is_command) {
if (!cursor_can_exit_tree) accept_event();