cleanup
This commit is contained in:
parent
a8d824ad16
commit
0a4e3c3006
|
@ -166,8 +166,8 @@ pub fn update_map_camera(
|
||||||
settings: Res<var::Settings>,
|
settings: Res<var::Settings>,
|
||||||
mut mapcam: ResMut<MapCam>,
|
mut mapcam: ResMut<MapCam>,
|
||||||
mut q_camera: Query<&mut Transform, (With<Camera>, Without<actor::PlayerCamera>)>,
|
mut q_camera: Query<&mut Transform, (With<Camera>, Without<actor::PlayerCamera>)>,
|
||||||
q_playercam: Query<(Entity, &Transform, &Position), (With<actor::PlayerCamera>, Without<Camera>)>,
|
q_playercam: Query<(Entity, &Transform), (With<actor::PlayerCamera>, Without<Camera>)>,
|
||||||
q_target: Query<(Entity, &Transform, &Position), (With<hud::IsTargeted>, Without<Camera>, Without<actor::PlayerCamera>)>,
|
q_target: Query<(Entity, &Transform), (With<hud::IsTargeted>, Without<Camera>, Without<actor::PlayerCamera>)>,
|
||||||
q_target_changed: Query<(), Changed<hud::IsTargeted>>,
|
q_target_changed: Query<(), Changed<hud::IsTargeted>>,
|
||||||
mut mouse_events: EventReader<MouseMotion>,
|
mut mouse_events: EventReader<MouseMotion>,
|
||||||
mut er_mousewheel: EventReader<MouseWheel>,
|
mut er_mousewheel: EventReader<MouseWheel>,
|
||||||
|
@ -177,11 +177,11 @@ pub fn update_map_camera(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let mut camera_transform = q_camera.get_single_mut().unwrap();
|
let mut camera_transform = q_camera.get_single_mut().unwrap();
|
||||||
let (player_entity, player_trans, player_pos) = q_playercam.get_single().unwrap();
|
let (player_entity, player_trans) = q_playercam.get_single().unwrap();
|
||||||
let (target_entity, target_trans, target_pos) = if let Ok(target) = q_target.get_single() {
|
let (target_entity, target_trans) = if let Ok(target) = q_target.get_single() {
|
||||||
target
|
target
|
||||||
} else {
|
} else {
|
||||||
(player_entity, player_trans, player_pos)
|
(player_entity, player_trans)
|
||||||
};
|
};
|
||||||
mapcam.center_on_entity = Some(target_entity);
|
mapcam.center_on_entity = Some(target_entity);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue