Fix unexpected crashes in notification

(cherry picked from commit 924c2078da)
This commit is contained in:
Zae 2021-10-22 19:44:38 +08:00 committed by Rémi Verschelde
parent d09b33dab2
commit a1b282cc16
No known key found for this signature in database
GPG key ID: C3336907360768E1
3 changed files with 4 additions and 0 deletions

View file

@ -133,6 +133,7 @@ void CollisionPolygon2D::_notification(int p_what) {
} break;
case NOTIFICATION_DRAW: {
ERR_FAIL_COND(!is_inside_tree());
if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
break;
}

View file

@ -94,6 +94,8 @@ void CollisionShape2D::_notification(int p_what) {
} break;
case NOTIFICATION_DRAW: {
ERR_FAIL_COND(!is_inside_tree());
if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
break;
}

View file

@ -155,6 +155,7 @@ void RayCast2D::_notification(int p_what) {
} break;
case NOTIFICATION_DRAW: {
ERR_FAIL_COND(!is_inside_tree());
if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
break;
}