summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/scene_tree_editor.cpp5
-rw-r--r--modules/bullet/rigid_body_bullet.cpp3
2 files changed, 7 insertions, 1 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 7e4baa1533..6602d2974f 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -678,6 +678,11 @@ void SceneTreeEditor::_renamed() {
error->set_text(TTR("Invalid node name, the following characters are not allowed:") + "\n" + Node::invalid_character);
error->popup_centered_minsize();
+ if (new_name.empty()) {
+ which->set_text(0, n->get_name());
+ return;
+ }
+
which->set_text(0, new_name);
}
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp
index 460ef043da..22f2214898 100644
--- a/modules/bullet/rigid_body_bullet.cpp
+++ b/modules/bullet/rigid_body_bullet.cpp
@@ -825,7 +825,8 @@ void RigidBodyBullet::reload_shapes() {
// shapes incorrectly do not set the vector in calculateLocalIntertia.
// Arbitrary zero is preferable to undefined behaviour.
btVector3 inertia(0, 0, 0);
- mainShape->calculateLocalInertia(mass, inertia);
+ if (EMPTY_SHAPE_PROXYTYPE != mainShape->getShapeType()) // Necessary to avoid assertion of the empty shape
+ mainShape->calculateLocalInertia(mass, inertia);
btBody->setMassProps(mass, inertia);
}
btBody->updateInertiaTensor();