diff --git a/servers/physics_server_2d.cpp b/servers/physics_server_2d.cpp index 8e743e0dc0b..2a4240baee9 100644 --- a/servers/physics_server_2d.cpp +++ b/servers/physics_server_2d.cpp @@ -199,7 +199,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 9384cdc7b86..f444c2883d5 100644 --- a/servers/physics_server_3d.cpp +++ b/servers/physics_server_3d.cpp @@ -194,7 +194,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; }