summaryrefslogtreecommitdiff
path: root/scene/3d/node_3d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/node_3d.cpp')
-rw-r--r--scene/3d/node_3d.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp
index 515d2cfdc7..62cc7c143b 100644
--- a/scene/3d/node_3d.cpp
+++ b/scene/3d/node_3d.cpp
@@ -147,8 +147,8 @@ void Node3D::_notification(int p_what) {
notification(NOTIFICATION_ENTER_WORLD);
_update_visibility_parent(true);
-
} break;
+
case NOTIFICATION_EXIT_TREE: {
notification(NOTIFICATION_EXIT_WORLD, true);
if (xform_change.in_list()) {
@@ -162,6 +162,7 @@ void Node3D::_notification(int p_what) {
data.top_level_active = false;
_update_visibility_parent(true);
} break;
+
case NOTIFICATION_ENTER_WORLD: {
data.inside_world = true;
data.viewport = nullptr;
@@ -192,6 +193,7 @@ void Node3D::_notification(int p_what) {
}
#endif
} break;
+
case NOTIFICATION_EXIT_WORLD: {
#ifdef TOOLS_ENABLED
clear_gizmos();
@@ -203,7 +205,6 @@ void Node3D::_notification(int p_what) {
data.viewport = nullptr;
data.inside_world = false;
-
} break;
case NOTIFICATION_TRANSFORM_CHANGED: {
@@ -213,9 +214,6 @@ void Node3D::_notification(int p_what) {
}
#endif
} break;
-
- default: {
- }
}
}
@@ -300,8 +298,9 @@ Node3D *Node3D::get_parent_node_3d() const {
}
Transform3D Node3D::get_relative_transform(const Node *p_parent) const {
- if (p_parent == this)
+ if (p_parent == this) {
return Transform3D();
+ }
ERR_FAIL_COND_V(!data.parent, Transform3D());