~starkingdoms/starkingdoms

c76b5b6aecccad32a55c6f939ddd9a17be32acee — ghostlyzsh 1 year, 10 months ago 60668da
appease the git gods
2 files changed, 45 insertions(+), 9 deletions(-)

M server/src/main.rs
M starkingdoms-client/src/hub.ts
M server/src/main.rs => server/src/main.rs +44 -8
@@ 297,7 297,14 @@ fn on_message(
        (Without<PlanetType>, Without<Player>),
    >,
    mut player_query: Query<
        (Entity, &mut Player, &Transform, &Velocity, &mut Attach, &mut PartFlags),
        (
            Entity,
            &mut Player,
            &Transform,
            &Velocity,
            &mut Attach,
            &mut PartFlags,
        ),
        Without<PlanetType>,
    >,
    mut packet_recv: Local<ManualEventReader<WsEvent>>,


@@ 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<PlanetType>, Without<Player>),
    >,
    player_query: &mut Query<
        (Entity, &mut Player, &Transform, &Velocity, &mut Attach, &mut PartFlags),
        (
            Entity,
            &mut Player,
            &Transform,
            &Velocity,
            &mut Attach,
            &mut PartFlags,
        ),
        Without<PlanetType>,
    >,
) {


@@ 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<PlanetType>, Without<Player>, Without<Attach>),
    >,
    player_query: &mut Query<
        (Entity, &mut Player, &Transform, &Velocity, &mut Attach, &mut PartFlags),
        (
            Entity,
            &mut Player,
            &Transform,
            &Velocity,
            &mut Attach,
            &mut PartFlags,
        ),
        Without<PlanetType>,
    >,
) -> bool {


@@ 1508,7 1529,17 @@ fn break_modules(
        ),
        (Without<PlanetType>, Without<Player>),
    >,
    mut player_query: Query<(Entity, &mut Player, &Transform, &Velocity, &mut Attach, &mut PartFlags), Without<PlanetType>>,
    mut player_query: Query<
        (
            Entity,
            &mut Player,
            &Transform,
            &Velocity,
            &mut Attach,
            &mut PartFlags,
        ),
        Without<PlanetType>,
    >,
) {
    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,
        );
    }
}


M starkingdoms-client/src/hub.ts => starkingdoms-client/src/hub.ts +1 -1
@@ 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") {