Fix panic when a collider is both added and removed before a call to CollisionPipeline::step

This commit is contained in:
shoebe
2022-06-05 15:48:52 -04:00
parent b00324756d
commit 2a83a44fd9

View File

@@ -94,7 +94,9 @@ impl CollisionPipeline {
modified_colliders: &mut Vec<ColliderHandle>,
) {
for handle in modified_colliders.drain(..) {
colliders.index_mut_internal(handle).changes = ColliderChanges::empty();
if let Some(co) = colliders.get_mut_internal(handle) {
co.changes = ColliderChanges::empty();
}
}
}