From e9df164995321a88eaca9ba606bb716acdb38fc6 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 27 Sep 2020 11:48:31 +0100 Subject: [PATCH] Increment index when populating PhysicsShapeQueryParameters exclude array. --- servers/physics_server_2d.cpp | 2 +- servers/physics_server_3d.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/physics_server_2d.cpp b/servers/physics_server_2d.cpp index 0dac08015f0..f6b6cf06763 100644 --- a/servers/physics_server_2d.cpp +++ b/servers/physics_server_2d.cpp @@ -197,7 +197,7 @@ Vector PhysicsShapeQueryParameters2D::get_exclude() const { ret.resize(exclude.size()); int idx = 0; for (Set::Element *E = exclude.front(); E; E = E->next()) { - ret.write[idx] = E->get(); + ret.write[idx++] = E->get(); } return ret; } diff --git a/servers/physics_server_3d.cpp b/servers/physics_server_3d.cpp index 33a2b919025..2c862b63cd8 100644 --- a/servers/physics_server_3d.cpp +++ b/servers/physics_server_3d.cpp @@ -193,7 +193,7 @@ Vector PhysicsShapeQueryParameters3D::get_exclude() const { ret.resize(exclude.size()); int idx = 0; for (Set::Element *E = exclude.front(); E; E = E->next()) { - ret.write[idx] = E->get(); + ret.write[idx++] = E->get(); } return ret; }