summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-04-04 09:35:48 +0200
committerGitHub <noreply@github.com>2022-04-04 09:35:48 +0200
commit25d36e085bcf3acd086477009fcd61a5fa9b8f99 (patch)
treec2b5c03ead65e64aeb92de28585f3ac6f5a9bf56
parent00879000a85b8c232773e348e23ebd215420263c (diff)
parentdb19cc60fb1aed98c54fb2722f525a624d56b17e (diff)
Merge pull request #59856 from KoBeWi/touching_spam
Fix TouchScreenButton error spam
-rw-r--r--scene/2d/touch_screen_button.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp
index 9a68c17269..4a4a2a1da0 100644
--- a/scene/2d/touch_screen_button.cpp
+++ b/scene/2d/touch_screen_button.cpp
@@ -190,7 +190,7 @@ String TouchScreenButton::get_action() const {
void TouchScreenButton::input(const Ref<InputEvent> &p_event) {
ERR_FAIL_COND(p_event.is_null());
- if (!get_tree()) {
+ if (!is_visible_in_tree()) {
return;
}
@@ -198,8 +198,6 @@ void TouchScreenButton::input(const Ref<InputEvent> &p_event) {
return;
}
- ERR_FAIL_COND(!is_visible_in_tree());
-
const InputEventScreenTouch *st = Object::cast_to<InputEventScreenTouch>(*p_event);
if (passby_press) {