Fix crash caused by a collider being remove before the first timestep.

This commit is contained in:
Crozet Sébastien
2021-04-03 12:03:49 +02:00
parent 7557d2a6ee
commit 5a0e6471cd
2 changed files with 40 additions and 1 deletions

View File

@@ -139,7 +139,9 @@ impl ColliderSet {
self.modified_all_colliders = false;
} else {
for handle in self.modified_colliders.drain(..) {
self.colliders[handle.0].changes = ColliderChanges::empty();
if let Some(co) = self.colliders.get_mut(handle.0) {
co.changes = ColliderChanges::empty();
}
}
}
}