diff options
author | trollodel <33117082+trollodel@users.noreply.github.com> | 2021-05-09 18:58:19 +0200 |
---|---|---|
committer | trollodel <33117082+trollodel@users.noreply.github.com> | 2021-05-09 18:58:19 +0200 |
commit | a24c46e7a09616668a303f1e8fcc4a5d62268e9c (patch) | |
tree | 98228a352f2f3bf450a4bcad9f56b257722642de /scene | |
parent | aac01456d16b2eb4171c8bee2e3cf5fb5d31a9ca (diff) |
Use the correct method in shape_owner_remove_shape
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/collision_object_3d.cpp | 6 | ||||
-rw-r--r-- | scene/3d/collision_object_3d.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp index 9e2912e60f..914b3ad816 100644 --- a/scene/3d/collision_object_3d.cpp +++ b/scene/3d/collision_object_3d.cpp @@ -200,7 +200,7 @@ void CollisionObject3D::_update_shape_data(uint32_t p_owner) { } } -void CollisionObject3D::_shape_changed(Ref<Shape3D> p_shape) { +void CollisionObject3D::_shape_changed(const Ref<Shape3D> &p_shape) { for (Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) { ShapeData &shapedata = E->get(); ShapeData::ShapeBase *shapes = shapedata.shapes.ptrw(); @@ -485,8 +485,8 @@ void CollisionObject3D::shape_owner_remove_shape(uint32_t p_owner, int p_shape) if (s.debug_shape.is_valid()) { RS::get_singleton()->free(s.debug_shape); - if (s.shape.is_valid() && s.shape->is_connected("changed", callable_mp(this, &CollisionObject3D::_update_shape_data))) { - s.shape->disconnect("changed", callable_mp(this, &CollisionObject3D::_update_shape_data)); + if (s.shape.is_valid() && s.shape->is_connected("changed", callable_mp(this, &CollisionObject3D::_shape_changed))) { + s.shape->disconnect("changed", callable_mp(this, &CollisionObject3D::_shape_changed)); } --debug_shapes_count; } diff --git a/scene/3d/collision_object_3d.h b/scene/3d/collision_object_3d.h index 80bfcbcf05..7ff3c5efde 100644 --- a/scene/3d/collision_object_3d.h +++ b/scene/3d/collision_object_3d.h @@ -72,7 +72,7 @@ class CollisionObject3D : public Node3D { bool _are_collision_shapes_visible(); void _update_shape_data(uint32_t p_owner); - void _shape_changed(Ref<Shape3D> p_shape); + void _shape_changed(const Ref<Shape3D> &p_shape); void _update_debug_shapes(); void _clear_debug_shapes(); |