From a2606569bb79867d07a075bcf7b05730e4264d72 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 11 Jun 2025 22:58:41 -0630 Subject: use owned instead of borrowed Vec3 more --- azalea/src/bot.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'azalea/src/bot.rs') diff --git a/azalea/src/bot.rs b/azalea/src/bot.rs index 9e8566bf..745f3fdb 100644 --- a/azalea/src/bot.rs +++ b/azalea/src/bot.rs @@ -229,7 +229,7 @@ fn look_at_listener( for event in events.read() { if let Ok((position, eye_height, mut look_direction)) = query.get_mut(event.entity) { let new_look_direction = - direction_looking_at(&position.up(eye_height.into()), &event.position); + direction_looking_at(position.up(eye_height.into()), event.position); trace!("look at {} (currently at {})", event.position, **position); *look_direction = new_look_direction; } @@ -238,7 +238,7 @@ fn look_at_listener( /// Return the look direction that would make a client at `current` be /// looking at `target`. -pub fn direction_looking_at(current: &Vec3, target: &Vec3) -> LookDirection { +pub fn direction_looking_at(current: Vec3, target: Vec3) -> LookDirection { // borrowed from mineflayer's Bot.lookAt because i didn't want to do math let delta = target - current; let y_rot = (PI - f64::atan2(-delta.x, -delta.z)) * (180.0 / PI); -- cgit v1.2.3