From 16d7a9ae2d450fb42969ff725467cf44c7f22943 Mon Sep 17 00:00:00 2001 From: yuni Date: Mon, 25 Nov 2024 22:55:03 +0100 Subject: [PATCH] map: fix hiding of orbit lines --- src/camera.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/camera.rs b/src/camera.rs index 5939d4b..27d19c8 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -671,7 +671,7 @@ pub fn apply_input_to_player( pub fn update_map_only_object_visibility( settings: Res, q_camera: Query<&Transform, With>, - q_player: Query<&Position, With>, + q_player: Query<(&Transform, &Position), (With, Without)>, mut q_onlyinmap: Query<(&mut Visibility, &ShowOnlyInMap), Without>, id2pos: Res, ) { @@ -679,8 +679,8 @@ pub fn update_map_only_object_visibility( return; } let cam: &Transform = q_camera.get_single().unwrap(); - let player_pos: &Position = q_player.get_single().unwrap(); - let cam_pos: Vec3 = cam.translation + player_pos.as_vec3(); + let (player_trans, player_pos) = q_player.get_single().unwrap(); + let cam_pos: Vec3 = cam.translation - player_trans.translation + player_pos.0.as_vec3(); for (mut vis, onlyinmap) in &mut q_onlyinmap { if settings.map_active && settings.hud_active { if onlyinmap.distance_to_id.is_empty() {