diff options
| author | Benjamin | 2018-06-10 17:54:42 +0200 |
|---|---|---|
| committer | Benjamin | 2018-06-10 17:54:42 +0200 |
| commit | 1535ffab06dcc6d7ad19eccc1b7b49c3d82bd5de (patch) | |
| tree | a3d73f1ae77d4a9532b418211d1e15b29a543f5a /modules/csg/csg_shape.cpp | |
| parent | 257d3c3f39fd144d202f112c9cb08a82c174afbc (diff) | |
| download | godot-1535ffab06dcc6d7ad19eccc1b7b49c3d82bd5de.tar.gz godot-1535ffab06dcc6d7ad19eccc1b7b49c3d82bd5de.tar.zst godot-1535ffab06dcc6d7ad19eccc1b7b49c3d82bd5de.zip | |
Diffstat (limited to 'modules/csg/csg_shape.cpp')
| -rw-r--r-- | modules/csg/csg_shape.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 82db1871d..ba27d6839 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -162,6 +162,10 @@ CSGBrush *CSGShape::_get_brush() { void CSGShape::_update_shape() { //print_line("updating shape for " + String(get_path())); + + if (parent) + return; + set_base(RID()); root_mesh.unref(); //byebye root mesh @@ -349,6 +353,10 @@ void CSGShape::_notification(int p_what) { Node *parentn = get_parent(); if (parentn) { parent = Object::cast_to<CSGShape>(parentn); + if (parent) { + set_base(RID()); + root_mesh.unref(); + } } if (use_collision && is_root_shape()) { @@ -371,6 +379,7 @@ void CSGShape::_notification(int p_what) { } if (p_what == NOTIFICATION_EXIT_TREE) { + if (parent) parent->_make_dirty(); parent = NULL; |
