diff --git a/servers/physics_2d_server.cpp b/servers/physics_2d_server.cpp index 71e3bf8ae89..49352e0f77f 100644 --- a/servers/physics_2d_server.cpp +++ b/servers/physics_2d_server.cpp @@ -199,7 +199,7 @@ Vector Physics2DShapeQueryParameters::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.cpp b/servers/physics_server.cpp index 4fe0c21cb20..fa90ef1f1e2 100644 --- a/servers/physics_server.cpp +++ b/servers/physics_server.cpp @@ -195,7 +195,7 @@ Vector PhysicsShapeQueryParameters::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; }