diff options
author | yakun.zhang <Raphael10241024@gmail.com> | 2019-05-05 13:30:58 +0800 |
---|---|---|
committer | yakun.zhang <Raphael10241024@gmail.com> | 2019-05-05 13:30:58 +0800 |
commit | 2206c5e9c0d531b3186c6acf4f16327682721900 (patch) | |
tree | dca1162806975ee28655d830fcb049b0af76cea5 /scene/3d/collision_shape.cpp | |
parent | 84401e8cdf4f41fc0e804bf5410622e75a08c0f5 (diff) |
fix CollisonShape changing shape cause crash when not in a tree
Diffstat (limited to 'scene/3d/collision_shape.cpp')
-rw-r--r-- | scene/3d/collision_shape.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp index 6bb2b547c7..f32b1398fd 100644 --- a/scene/3d/collision_shape.cpp +++ b/scene/3d/collision_shape.cpp @@ -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"); } |