1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Merge pull request #10770 from RandomShaper/fix-joints

Fix joints collision exceptions, plus a bit more
This commit is contained in:
Rémi Verschelde
2017-10-31 23:02:37 +01:00
committed by GitHub
5 changed files with 59 additions and 120 deletions

View File

@@ -233,14 +233,7 @@ void PhysicsServerSW::area_set_space(RID p_area, RID p_space) {
if (area->get_space() == space)
return; //pointless
for (Set<ConstraintSW *>::Element *E = area->get_constraints().front(); E; E = E->next()) {
RID self = E->get()->get_self();
if (!self.is_valid())
continue;
free(self);
}
area->clear_constraints();
area->set_space(space);
};
@@ -494,14 +487,7 @@ void PhysicsServerSW::body_set_space(RID p_body, RID p_space) {
if (body->get_space() == space)
return; //pointless
for (Map<ConstraintSW *, int>::Element *E = body->get_constraint_map().front(); E; E = E->next()) {
RID self = E->key()->get_self();
if (!self.is_valid())
continue;
free(self);
}
body->clear_constraint_map();
body->set_space(space);
};