diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-05-22 18:04:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-22 18:04:14 +0200 |
commit | 3c23e026ac2f914ed2afa535854eb55a2af9e40f (patch) | |
tree | 1558af6fc0359aa62e43e5844701322e0742b11a | |
parent | 97d433a27214e5b3cdac5d0119238d3d6d6e0241 (diff) | |
parent | fea75bb1124cc6e4b507640ce0ca568eb6812edb (diff) |
Merge pull request #48973 from trollodel/debug_shapes_update_crash
Fix crash on debug shapes update if CollisionObject3D is not in tree
-rw-r--r-- | scene/3d/collision_object_3d.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp index 914b3ad816..cba769a8f8 100644 --- a/scene/3d/collision_object_3d.cpp +++ b/scene/3d/collision_object_3d.cpp @@ -215,6 +215,11 @@ void CollisionObject3D::_shape_changed(const Ref<Shape3D> &p_shape) { } void CollisionObject3D::_update_debug_shapes() { + if (!is_inside_tree()) { + debug_shapes_to_update.clear(); + return; + } + for (Set<uint32_t>::Element *shapedata_idx = debug_shapes_to_update.front(); shapedata_idx; shapedata_idx = shapedata_idx->next()) { if (shapes.has(shapedata_idx->get())) { ShapeData &shapedata = shapes[shapedata_idx->get()]; |