summaryrefslogtreecommitdiffstats
path: root/servers
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-09-21 14:27:46 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-09-21 14:27:46 +0200
commitfe5b1c8d49313d63fbe91cb7cdf463e10fb86afa (patch)
treed5b138718acb233b94aa9f0b392d604234beeea8 /servers
parent603119d301bf7c47d44ea53afcc71d895976f80a (diff)
parent95eafcba4ca34e704fcc8bf5b4e5d7daf0664917 (diff)
downloadredot-engine-fe5b1c8d49313d63fbe91cb7cdf463e10fb86afa.tar.gz
Merge pull request #82043 from AThousandShips/exclude_fix
Fix missing clear for some `set_exclude*` query parameter methods
Diffstat (limited to 'servers')
-rw-r--r--servers/physics_server_2d.cpp2
-rw-r--r--servers/physics_server_3d.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/servers/physics_server_2d.cpp b/servers/physics_server_2d.cpp
index 79a8ebe3d1..a5fa5291c0 100644
--- a/servers/physics_server_2d.cpp
+++ b/servers/physics_server_2d.cpp
@@ -476,6 +476,7 @@ TypedArray<RID> PhysicsTestMotionParameters2D::get_exclude_bodies() const {
}
void PhysicsTestMotionParameters2D::set_exclude_bodies(const TypedArray<RID> &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<uint64_t> PhysicsTestMotionParameters2D::get_exclude_objects() const
}
void PhysicsTestMotionParameters2D::set_exclude_objects(const TypedArray<uint64_t> &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 0dfc87f199..d523f4b1ec 100644
--- a/servers/physics_server_3d.cpp
+++ b/servers/physics_server_3d.cpp
@@ -501,6 +501,7 @@ TypedArray<RID> PhysicsTestMotionParameters3D::get_exclude_bodies() const {
}
void PhysicsTestMotionParameters3D::set_exclude_bodies(const TypedArray<RID> &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<uint64_t> PhysicsTestMotionParameters3D::get_exclude_objects() const
}
void PhysicsTestMotionParameters3D::set_exclude_objects(const TypedArray<uint64_t> &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());