diff --git a/strafe-client/src/physics.rs b/strafe-client/src/physics.rs index 51fbf94..1fb2571 100644 --- a/strafe-client/src/physics.rs +++ b/strafe-client/src/physics.rs @@ -235,11 +235,11 @@ impl PhysicsModels{ } fn get_model_transform(&self,model_id:ModelId)->Option<&PhysicsMeshTransform>{ //ModelId can possibly be a decoration - self.contact_models.get(&ContactModelId::new(model_id.get())).map_or_else( - ||self.intersect_models.get(&IntersectModelId::new(model_id.get())) + match self.contact_models.get(&ContactModelId::new(model_id.get())){ + Some(model)=>Some(&model.transform), + None=>self.intersect_models.get(&IntersectModelId::new(model_id.get())) .map(|model|&model.transform), - |model|Some(&model.transform) - ) + } } fn contact_model(&self,model_id:ContactModelId)->&ContactModel{ &self.contact_models[&model_id]