From 52f6ec2ea7bf94028f7beb9e2a0878953d6dda06 Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 4 Apr 2022 01:47:40 +0200 Subject: [PATCH] Fix TouchScreenButton error spam (cherry picked from commit db19cc60fb1aed98c54fb2722f525a624d56b17e) --- scene/2d/touch_screen_button.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index 7243c911f3..a0244d2d46 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -187,7 +187,7 @@ String TouchScreenButton::get_action() const { void TouchScreenButton::_input(const Ref &p_event) { ERR_FAIL_COND(p_event.is_null()); - if (!get_tree()) { + if (!is_visible_in_tree()) { return; } @@ -195,8 +195,6 @@ void TouchScreenButton::_input(const Ref &p_event) { return; } - ERR_FAIL_COND(!is_visible_in_tree()); - const InputEventScreenTouch *st = Object::cast_to(*p_event); if (passby_press) {