This commit is contained in:
yuni 2024-10-05 03:03:19 +02:00
parent 7a7b4422d1
commit 2409da8fed

View file

@ -696,7 +696,7 @@ fn handle_wants_maxvelocity(
}
fn handle_wants_lookat(
mut query: Query<(&Position, &mut Rotation, &Transform, &WantsToLookAt), Without<Camera>>,
mut query: Query<(&Position, &mut Rotation, &WantsToLookAt), Without<Camera>>,
q_playercam: Query<&Position, With<PlayerCamera>>,
q_cam: Query<&Transform, With<Camera>>,
id2pos: Res<game::Id2Pos>,
@ -713,7 +713,7 @@ fn handle_wants_lookat(
};
// TODO: use ExternalTorque rather than hard-resetting the rotation
for (pos, mut rot, trans, target_id) in &mut query {
for (pos, mut rot, target_id) in &mut query {
let target_pos: DVec3 = if target_id.0 == cmd::ID_SPECIAL_PLAYERCAM {
cam_pos
} else if let Some(target_pos) = id2pos.0.get(&target_id.0) {