diff --git a/src/map.rs b/src/map.rs index 018c2e2..601c634 100644 --- a/src/map.rs +++ b/src/map.rs @@ -210,12 +210,14 @@ fn spawn_colliders( ) { for (map_entity, map, spawn_colliders, spawn_collider_per_tile) in maps.iter() { if **spawn_colliders { - commands.entity(map_entity).remove::(); - commands.entity(map_entity).remove::(); - commands.entity(map_entity).insert_bundle(RigidBodyBundle { - body_type: RigidBodyType::Static, - ..Default::default() - }); + commands + .entity(map_entity) + .remove::() + .remove::() + .insert_bundle(RigidBodyBundle { + body_type: RigidBodyType::Static, + ..Default::default() + }); if **spawn_collider_per_tile { for y in 0..map.height { for x in 0..map.width { @@ -335,10 +337,8 @@ fn spawn_colliders( } } for room in &map.rooms { - let shape = ColliderShape::cuboid( - (room.width() / 2) as f32 + 0.5, - (room.height() / 2) as f32 + 0.5, - ); + let shape = + ColliderShape::cuboid((room.width() / 2) as f32, (room.height() / 2) as f32); let position = Vec2::new(room.center().x() + 0.5, room.center().y() + 0.5).into(); let id = commands .spawn_bundle(ColliderBundle {