From c76b5b6aecccad32a55c6f939ddd9a17be32acee Mon Sep 17 00:00:00 2001 From: ghostlyzsh Date: Wed, 17 Jan 2024 17:13:09 -0600 Subject: [PATCH] appease the git gods --- server/src/main.rs | 52 ++++++++++++++++++++++++++++------ starkingdoms-client/src/hub.ts | 2 +- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/server/src/main.rs b/server/src/main.rs index 80fe988b636b108ec4249e1ba6154fc5a77a73e9..0b0703d35c73ca58befeffeb474c143eeace5250 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -297,7 +297,14 @@ fn on_message( (Without, Without), >, mut player_query: Query< - (Entity, &mut Player, &Transform, &Velocity, &mut Attach, &mut PartFlags), + ( + Entity, + &mut Player, + &Transform, + &Velocity, + &mut Attach, + &mut PartFlags, + ), Without, >, mut packet_recv: Local>, @@ -648,7 +655,8 @@ fn on_message( module.2.translation = vec3(x, y, 0.); if *module.1 == PartType::LandingThruster { let sub_entity = attach.children[2].unwrap(); - let mut suspension = attached_query.get_mut(sub_entity).unwrap(); + let mut suspension = + attached_query.get_mut(sub_entity).unwrap(); suspension.2.translation = vec3(x, y, 0.); } break; @@ -1017,7 +1025,14 @@ fn detach_recursive( (Without, Without), >, player_query: &mut Query< - (Entity, &mut Player, &Transform, &Velocity, &mut Attach, &mut PartFlags), + ( + Entity, + &mut Player, + &Transform, + &Velocity, + &mut Attach, + &mut PartFlags, + ), Without, >, ) { @@ -1030,8 +1045,7 @@ fn detach_recursive( detach_recursive(commands, *child, attached_query, player_query); } let (entity, part_type, attach, mut flags) = if attached_query.contains(this) { - let (entity, part_type, _, attach, _, _, _, flags) = - attached_query.get_mut(this).unwrap(); + let (entity, part_type, _, attach, _, _, _, flags) = attached_query.get_mut(this).unwrap(); (entity, part_type, attach, flags) } else { let (entity, _, _, _, attach, part_flags) = player_query.get_mut(this).unwrap(); @@ -1102,7 +1116,14 @@ fn attach_on_module_tree( (Without, Without, Without), >, player_query: &mut Query< - (Entity, &mut Player, &Transform, &Velocity, &mut Attach, &mut PartFlags), + ( + Entity, + &mut Player, + &Transform, + &Velocity, + &mut Attach, + &mut PartFlags, + ), Without, >, ) -> bool { @@ -1508,7 +1529,17 @@ fn break_modules( ), (Without, Without), >, - mut player_query: Query<(Entity, &mut Player, &Transform, &Velocity, &mut Attach, &mut PartFlags), Without>, + mut player_query: Query< + ( + Entity, + &mut Player, + &Transform, + &Velocity, + &mut Attach, + &mut PartFlags, + ), + Without, + >, ) { let joints = rapier_context.entity2impulse_joint(); let mut detach_list = Vec::new(); @@ -1524,7 +1555,12 @@ fn break_modules( } } for (entity, _part_type, _attach) in detach_list { - detach_recursive(&mut commands, entity, &mut attached_query, &mut player_query); + detach_recursive( + &mut commands, + entity, + &mut attached_query, + &mut player_query, + ); } } diff --git a/starkingdoms-client/src/hub.ts b/starkingdoms-client/src/hub.ts index 653018304de571491d3bb1ed363b55736afdd572..52063eea148c0ea8ace5920c0c4d7b048c0dbaf5 100644 --- a/starkingdoms-client/src/hub.ts +++ b/starkingdoms-client/src/hub.ts @@ -80,7 +80,7 @@ export async function hub_connect( document.onkeydown = (e) => { // Exit if key is not registered. // If adding a handler, add key sym to this array - let inputKeys = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]; + let inputKeys = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "w", "s", "a", "d"]; if (inputKeys.indexOf(e.key) == -1) return; if (e.key == "ArrowUp" || e.key == "w") {