From 0a4e3c3006f7d820ddab506cf104fc98756e8155 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 8 May 2024 01:00:58 +0200 Subject: [PATCH] cleanup --- src/camera.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/camera.rs b/src/camera.rs index d658bdc..22cba50 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -166,8 +166,8 @@ pub fn update_map_camera( settings: Res, mut mapcam: ResMut, mut q_camera: Query<&mut Transform, (With, Without)>, - q_playercam: Query<(Entity, &Transform, &Position), (With, Without)>, - q_target: Query<(Entity, &Transform, &Position), (With, Without, Without)>, + q_playercam: Query<(Entity, &Transform), (With, Without)>, + q_target: Query<(Entity, &Transform), (With, Without, Without)>, q_target_changed: Query<(), Changed>, mut mouse_events: EventReader, mut er_mousewheel: EventReader, @@ -177,11 +177,11 @@ pub fn update_map_camera( return; } let mut camera_transform = q_camera.get_single_mut().unwrap(); - let (player_entity, player_trans, player_pos) = q_playercam.get_single().unwrap(); - let (target_entity, target_trans, target_pos) = if let Ok(target) = q_target.get_single() { + let (player_entity, player_trans) = q_playercam.get_single().unwrap(); + let (target_entity, target_trans) = if let Ok(target) = q_target.get_single() { target } else { - (player_entity, player_trans, player_pos) + (player_entity, player_trans) }; mapcam.center_on_entity = Some(target_entity);