From 6adca217fe0fdc7173e9c159ddd55b315c641fa0 Mon Sep 17 00:00:00 2001 From: TelepathicWalrus Date: Sat, 6 May 2023 10:49:32 +0100 Subject: [PATCH] Clean code --- server/src/events/interaction.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server/src/events/interaction.rs b/server/src/events/interaction.rs index 73489bd566..3acd1e4147 100755 --- a/server/src/events/interaction.rs +++ b/server/src/events/interaction.rs @@ -133,10 +133,11 @@ pub fn handle_mount(server: &mut Server, rider: EcsEntity, mount: EcsEntity) { }); let is_stay = state - .ecs() - .read_storage::() - .get(mount) - .and_then(|x| x.stay_pos).is_some(); + .ecs() + .read_storage::() + .get(mount) + .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 { drop(uids); @@ -230,8 +231,10 @@ pub fn handle_toggle_stay(server: &mut Server, command_giver: EcsEntity, pet: Ec if prev_pet_pos.is_none() { new_pet_pos = state.ecs().read_storage::().get(pet).copied(); } - if is_owner && within_mounting_range(positions.get(command_giver), positions.get(pet)) - && state.ecs().read_storage::>().get(pet).is_none() { + if is_owner + && within_mounting_range(positions.get(command_giver), positions.get(pet)) + && state.ecs().read_storage::>().get(pet).is_none() + { let _ = state .ecs() .write_storage::()