diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-10-07 16:22:04 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-10-07 16:22:04 +0200 |
commit | e355a8fc4c36d4417b32acd0d5cf27a1b15d6669 (patch) | |
tree | 5537f3374d58d5f69de7f328e0d59bd75d240e2c /scene/gui/tree.cpp | |
parent | e0871b0f525f9b605542307512ef773955a6999a (diff) |
Fix crash in Tree when moving using Joypad
Diffstat (limited to 'scene/gui/tree.cpp')
-rw-r--r-- | scene/gui/tree.cpp | 5 |
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(); |