From 95eafcba4ca34e704fcc8bf5b4e5d7daf0664917 Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Thu, 21 Sep 2023 13:30:57 +0200 Subject: [PATCH] Fix missing clear for some `set_exclude*` query parameter methods --- servers/physics_server_2d.cpp | 2 ++ servers/physics_server_3d.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/servers/physics_server_2d.cpp b/servers/physics_server_2d.cpp index 79a8ebe3d1e1..a5fa5291c04e 100644 --- a/servers/physics_server_2d.cpp +++ b/servers/physics_server_2d.cpp @@ -476,6 +476,7 @@ TypedArray PhysicsTestMotionParameters2D::get_exclude_bodies() const { } void PhysicsTestMotionParameters2D::set_exclude_bodies(const TypedArray &p_exclude) { + parameters.exclude_bodies.clear(); for (int i = 0; i < p_exclude.size(); i++) { parameters.exclude_bodies.insert(p_exclude[i]); } @@ -494,6 +495,7 @@ TypedArray PhysicsTestMotionParameters2D::get_exclude_objects() const } void PhysicsTestMotionParameters2D::set_exclude_objects(const TypedArray &p_exclude) { + parameters.exclude_objects.clear(); for (int i = 0; i < p_exclude.size(); ++i) { ObjectID object_id = p_exclude[i]; ERR_CONTINUE(object_id.is_null()); diff --git a/servers/physics_server_3d.cpp b/servers/physics_server_3d.cpp index 0dfc87f19915..d523f4b1ec41 100644 --- a/servers/physics_server_3d.cpp +++ b/servers/physics_server_3d.cpp @@ -501,6 +501,7 @@ TypedArray PhysicsTestMotionParameters3D::get_exclude_bodies() const { } void PhysicsTestMotionParameters3D::set_exclude_bodies(const TypedArray &p_exclude) { + parameters.exclude_bodies.clear(); for (int i = 0; i < p_exclude.size(); i++) { parameters.exclude_bodies.insert(p_exclude[i]); } @@ -519,6 +520,7 @@ TypedArray PhysicsTestMotionParameters3D::get_exclude_objects() const } void PhysicsTestMotionParameters3D::set_exclude_objects(const TypedArray &p_exclude) { + parameters.exclude_objects.clear(); for (int i = 0; i < p_exclude.size(); ++i) { ObjectID object_id = p_exclude[i]; ERR_CONTINUE(object_id.is_null());