From dba6c4183a07109d00d6e230a91bcb7b81c42b0a Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 20 Apr 2024 02:37:00 +0200 Subject: [PATCH] hide orbital circles when AR is off --- src/camera.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/camera.rs b/src/camera.rs index b196070..8e5bbca 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -511,8 +511,8 @@ pub fn update_map_only_object_visibility( let player_pos: &Position = q_player.get_single().unwrap(); let cam_pos: Vec3 = cam.translation + player_pos.as_vec3(); for (mut vis, onlyinmap) in &mut q_onlyinmap { - if let Some(pos) = id2pos.0.get(&onlyinmap.distance_to_id) { - if settings.map_active { + if settings.map_active && settings.hud_active { + if let Some(pos) = id2pos.0.get(&onlyinmap.distance_to_id) { let dist = cam_pos.distance(pos.as_vec3()); if dist >= onlyinmap.min_distance as f32 { *vis = Visibility::Inherited; @@ -520,12 +520,11 @@ pub fn update_map_only_object_visibility( else { *vis = Visibility::Hidden; } - } - else { + } else { + error!("Failed get position of actor ID '{}'", &onlyinmap.distance_to_id); *vis = Visibility::Hidden; } } else { - error!("Failed get position of actor ID '{}'", &onlyinmap.distance_to_id); *vis = Visibility::Hidden; } }