Merge pull request #28696 from raphael10241024/debug_fix

fix CollisonShape changing shape cause crash when not in a tree
This commit is contained in:
Rémi Verschelde 2019-05-06 10:42:56 +02:00 committed by GitHub
commit 563d4b0e7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,7 +228,7 @@ void CollisionShape::_update_debug_shape() {
}
void CollisionShape::_shape_changed() {
if (get_tree()->is_debugging_collisions_hint() && !debug_shape_dirty) {
if (is_inside_tree() && get_tree()->is_debugging_collisions_hint() && !debug_shape_dirty) {
debug_shape_dirty = true;
call_deferred("_update_debug_shape");
}