From 2cb8e2ca842dce4465aa894ed956e8d92a071dde Mon Sep 17 00:00:00 2001 From: TelepathicWalrus Date: Sat, 13 May 2023 15:02:55 +0100 Subject: [PATCH] Update code quality --- server/src/events/interaction.rs | 3 ++- server/src/sys/agent/behavior_tree.rs | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/server/src/events/interaction.rs b/server/src/events/interaction.rs index 3e0fd2a92d..502759e474 100755 --- a/server/src/events/interaction.rs +++ b/server/src/events/interaction.rs @@ -139,7 +139,8 @@ pub fn handle_mount(server: &mut Server, rider: EcsEntity, mount: EcsEntity) { .and_then(|x| x.stay_pos) .is_some(); - if (is_pet_of(mount, rider_uid) || is_pet_of(rider, mount_uid)) && can_ride && !is_stay { + if (is_pet_of(mount, rider_uid) || is_pet_of(rider, mount_uid)) && can_ride && !is_stay + { drop(uids); let _ = state.link(Mounting { mount: mount_uid, diff --git a/server/src/sys/agent/behavior_tree.rs b/server/src/sys/agent/behavior_tree.rs index 9e8b385997..0ab52c3ccd 100755 --- a/server/src/sys/agent/behavior_tree.rs +++ b/server/src/sys/agent/behavior_tree.rs @@ -412,17 +412,23 @@ fn follow_if_far_away(bdata: &mut BehaviorData) -> bool { let distance_from_stay = stay_pos.0.distance_squared(bdata.agent_data.pos.0); if distance_from_stay > (MAX_STAY_DISTANCE).powi(2) { - bdata - .agent_data - .follow(bdata.agent, bdata.controller, bdata.read_data, &stay_pos); + bdata.agent_data.follow( + bdata.agent, + bdata.controller, + bdata.read_data, + &stay_pos, + ); return true; } } else { let dist_sqrd = bdata.agent_data.pos.0.distance_squared(tgt_pos.0); if dist_sqrd > (MAX_PATROL_DIST * bdata.agent.psyche.idle_wander_factor).powi(2) { - bdata - .agent_data - .follow(bdata.agent, bdata.controller, bdata.read_data, tgt_pos); + bdata.agent_data.follow( + bdata.agent, + bdata.controller, + bdata.read_data, + tgt_pos, + ); return true; } }