@@ 173,7 173,7 @@ fn module_spawn(
let mut entity = commands.spawn(PartBundle {
part_type: PartType::Cargo,
transform: TransformBundle::from(transform),
- flags
+ flags,
});
entity
.insert(RigidBody::Dynamic)
@@ 201,7 201,7 @@ fn module_spawn(
part: Part {
part_type: PartType::Cargo,
transform: proto_transform!(transform),
- flags: proto_part_flags!(flags)
+ flags: proto_part_flags!(flags),
},
};
let buf = serde_json::to_vec(&packet).unwrap();
@@ 234,7 234,7 @@ fn on_message(
&Velocity,
Option<&CanAttach>,
Option<&LooseAttach>,
- &mut PartFlags
+ &mut PartFlags,
),
(Without<PlanetType>, Without<Player>),
>,
@@ 287,7 287,7 @@ fn on_message(
part: PartBundle {
part_type: PartType::Hearty,
transform: TransformBundle::from(transform),
- flags: PartFlags { attached: false }
+ flags: PartFlags { attached: false },
},
player: Player {
addr: *addr,
@@ 379,7 379,7 @@ fn on_message(
transform: proto_transform!(Transform::from_translation(
transform.translation * SCALE
)),
- flags: proto_part_flags!(flags)
+ flags: proto_part_flags!(flags),
},
));
}
@@ 391,7 391,7 @@ fn on_message(
transform: proto_transform!(Transform::from_translation(
transform.translation * SCALE
)),
- flags: proto_part_flags!(flags)
+ flags: proto_part_flags!(flags),
},
));
}
@@ 403,7 403,7 @@ fn on_message(
transform.translation * SCALE
)
.with_rotation(transform.rotation)),
- flags: ProtoPartFlags { attached: false }
+ flags: ProtoPartFlags { attached: false },
},
));
let packet = Packet::PartPositions { parts };
@@ 916,7 916,7 @@ fn detach_recursive(
&Velocity,
Option<&CanAttach>,
Option<&LooseAttach>,
- &mut PartFlags
+ &mut PartFlags,
),
(Without<PlanetType>, Without<Player>),
>,
@@ 944,7 944,6 @@ fn detach_recursive(
commands.entity(parent).insert(LooseAttach {
children: parent_attach.children,
});
-
} else {
flags.attached = false;
commands.entity(entity).remove::<ImpulseJoint>();
@@ 985,7 984,7 @@ fn attach_on_module_tree(
&Velocity,
Option<&CanAttach>,
Option<&LooseAttach>,
- &mut PartFlags
+ &mut PartFlags,
),
(Without<PlanetType>, Without<Player>),
>,
@@ 996,7 995,7 @@ fn attach_on_module_tree(
&mut Transform,
&mut Velocity,
Option<&LooseAttach>,
- &mut PartFlags
+ &mut PartFlags,
),
(Without<PlanetType>, Without<Player>, Without<Attach>),
>,
@@ 1165,7 1164,14 @@ fn convert_modules(
planet_query: Query<(Entity, &PlanetType, &Children)>,
player_query: Query<&Attach, With<Player>>,
mut attached_query: Query<
- (Entity, &mut PartType, &mut Attach, &Children, &Transform, &PartFlags),
+ (
+ Entity,
+ &mut PartType,
+ &mut Attach,
+ &Children,
+ &Transform,
+ &PartFlags,
+ ),
Without<Player>,
>,
mut collider_query: Query<
@@ 1227,7 1233,14 @@ fn convert_modules_recursive(
planet_type: PlanetType,
attach: Attach,
attached_query: &mut Query<
- (Entity, &mut PartType, &mut Attach, &Children, &Transform, &PartFlags),
+ (
+ Entity,
+ &mut PartType,
+ &mut Attach,
+ &Children,
+ &Transform,
+ &PartFlags,
+ ),
Without<Player>,
>,
collider_query: &mut Query<
@@ 1266,7 1279,7 @@ fn convert_modules_recursive(
part: Part {
part_type: PartType::Hub,
transform: proto_transform!(transform),
- flags: proto_part_flags!(part_flags)
+ flags: proto_part_flags!(part_flags),
},
};
let buf = serde_json::to_vec(&packet).unwrap();
@@ 1289,7 1302,7 @@ fn convert_modules_recursive(
let mut suspension = commands.spawn(PartBundle {
transform: TransformBundle::from(*module_transform),
part_type: PartType::LandingThrusterSuspension,
- flags: PartFlags { attached: false }
+ flags: PartFlags { attached: false },
});
suspension
.insert(RigidBody::Dynamic)
@@ 1328,7 1341,7 @@ fn convert_modules_recursive(
part: Part {
part_type: PartType::LandingThruster,
transform: proto_transform!(transform),
- flags: proto_part_flags!(part_flags)
+ flags: proto_part_flags!(part_flags),
},
};
let buf = serde_json::to_vec(&packet).unwrap();
@@ 1340,7 1353,7 @@ fn convert_modules_recursive(
part: Part {
part_type: PartType::LandingThrusterSuspension,
transform: proto_transform!(transform),
- flags: proto_part_flags!(part_flags)
+ flags: proto_part_flags!(part_flags),
},
};
let buf = serde_json::to_vec(&packet).unwrap();
@@ 1375,7 1388,7 @@ fn break_modules(
&Velocity,
Option<&CanAttach>,
Option<&LooseAttach>,
- &mut PartFlags
+ &mut PartFlags,
),
(Without<PlanetType>, Without<Player>),
>,
@@ 1403,10 1416,9 @@ fn break_modules(
});
if (attach.children[2].is_some()) {
commands
- .entity(attach.children[2].unwrap())
- .remove::<Attach>();
+ .entity(attach.children[2].unwrap())
+ .remove::<Attach>();
}
-
} else {
detach_recursive(&mut commands, attach.clone(), &mut attached_query);
}
@@ 1568,7 1580,7 @@ fn on_position_change(
transform.translation * SCALE
)
.with_rotation(transform.rotation)),
- flags: proto_part_flags!(flags)
+ flags: proto_part_flags!(flags),
},
));
}