@@ 135,7 135,7 @@ impl StkTungsteniteServerPlugin {
move || loop {
let msg = l_stream.read().expect("failed to read message from stream");
if let Message::Close(_) = msg {
- l_stream.close(None).expect("failed to disconnect client");
+ let _ = l_stream.close(None);
l_gtx.send(WsEvent::Close { addr: this_addr }).unwrap();
break;
}
@@ 95,7 95,7 @@ fn main() {
)
.add_systems(FixedUpdate, save_eligibility)
.add_systems(FixedUpdate, convert_modules)
- //.insert_resource(Time::<Fixed>::from_seconds(1.0/20.0))
+ //.insert_resource(Time::<Fixed>::from_seconds(1.0/1.0))
.run();
info!("Goodbye!");
@@ 1003,21 1003,21 @@ fn load_savefile(
angle_offset = -PI / 2.;
}
+ let transform =
+ Transform::from_xyz(
+ p_pos.x + offset.x / SCALE * angle.cos() - offset.y / SCALE * angle.sin(),
+ p_pos.y + offset.x / SCALE * angle.sin() + offset.y / SCALE * angle.cos(),
+ 0.,
+ )
+ .with_rotation(Quat::from_euler(
+ EulerRot::ZYX,
+ angle + angle_offset,
+ 0.,
+ 0.,
+ ));
let module_id = {
let module = commands.spawn(PartBundle {
- transform: TransformBundle::from(
- Transform::from_xyz(
- (p_pos.x + offset.x * angle.cos()) / SCALE,
- (p_pos.y + offset.y * angle.sin()) / SCALE,
- 0.,
- )
- .with_rotation(Quat::from_euler(
- EulerRot::ZYX,
- angle + angle_offset,
- 0.,
- 0.,
- )),
- ),
+ transform: TransformBundle::from(transform),
part_type: child.part_type.into(),
flags: PartFlags { attached: true },
});