summaryrefslogtreecommitdiff
path: root/scene/3d/soft_dynamic_body_3d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/soft_dynamic_body_3d.cpp')
-rw-r--r--scene/3d/soft_dynamic_body_3d.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/scene/3d/soft_dynamic_body_3d.cpp b/scene/3d/soft_dynamic_body_3d.cpp
index 43292d42f1..903eedb58b 100644
--- a/scene/3d/soft_dynamic_body_3d.cpp
+++ b/scene/3d/soft_dynamic_body_3d.cpp
@@ -552,15 +552,9 @@ void SoftDynamicBody3D::set_disable_mode(DisableMode p_mode) {
return;
}
- bool inside_tree = is_inside_tree();
-
- if (inside_tree && (disable_mode == DISABLE_MODE_REMOVE)) {
- _prepare_physics_server();
- }
-
disable_mode = p_mode;
- if (inside_tree && (disable_mode == DISABLE_MODE_REMOVE)) {
+ if (mesh.is_valid() && is_inside_tree() && !is_enabled()) {
_prepare_physics_server();
}
}